修改bug
This commit is contained in:
@@ -46,3 +46,11 @@ export function analyseWave(params: string) {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//下载波形数据
|
||||
export function downloadWave(params: string) {
|
||||
return createAxios({
|
||||
url: '/cs-harmonic-boot/event/getFileZip?eventId=' + params,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -14,12 +14,10 @@
|
||||
<popup ref="detailRef"></popup>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, provide, watch, onBeforeUnmount } from 'vue'
|
||||
import { ref, onMounted, provide, onBeforeUnmount } from 'vue'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ArrowLeft } from '@element-plus/icons-vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import popup from './popup.vue'
|
||||
const emit = defineEmits(['back'])
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
@@ -349,13 +349,12 @@ import { mainHeight } from '@/utils/layout'
|
||||
import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictTree'
|
||||
import {
|
||||
getDeviceData,
|
||||
getTabsDataByType,
|
||||
getBasicRealData,
|
||||
getHarmRealData,
|
||||
getOverLimitData
|
||||
} from '@/api/cs-device-boot/EquipmentDelivery'
|
||||
import { deviceHisData, deviceRtData, getGroup } from '@/api/cs-device-boot/csGroup'
|
||||
import { ref, reactive, nextTick, onMounted, watch, onUnmounted, inject } from 'vue'
|
||||
import { deviceHisData, deviceRtData } from '@/api/cs-device-boot/csGroup'
|
||||
import { ref, reactive, onMounted, onUnmounted, inject, nextTick } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import Trend from './tabs/trend.vue' //趋势数据
|
||||
@@ -367,20 +366,7 @@ import offLineDataImport from './offLineDataImport/index.vue'
|
||||
import Event from './tabs/event.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import type { UserConfig, ConfigEnv } from 'vite'
|
||||
import {
|
||||
Platform,
|
||||
Histogram,
|
||||
TrendCharts,
|
||||
DataLine,
|
||||
ArrowLeft,
|
||||
DataAnalysis,
|
||||
Odometer,
|
||||
Monitor,
|
||||
Timer,
|
||||
Back
|
||||
} from '@element-plus/icons-vue'
|
||||
import { Histogram, TrendCharts, DataLine, DataAnalysis, Odometer, Monitor, Timer, Back } from '@element-plus/icons-vue'
|
||||
import analysisList from './analysisList/index.vue'
|
||||
import mqtt from 'mqtt'
|
||||
defineOptions({
|
||||
@@ -858,10 +844,11 @@ const handleClick = async (tab?: any) => {
|
||||
|
||||
//查询历史指标
|
||||
if (dataSet.value.includes('_history')) {
|
||||
await nextTick(() => {
|
||||
formInline.startTime = datePickerRef.value && datePickerRef.value.timeValue[0]
|
||||
formInline.endTime = datePickerRef.value && datePickerRef.value.timeValue[1]
|
||||
formInline.id = dataSet.value.replace('_history', '')
|
||||
await deviceHisData(formInline)
|
||||
deviceHisData(formInline)
|
||||
.then((res: any) => {
|
||||
tableData.value = res.data.records
|
||||
formInline.total = res.data.total
|
||||
@@ -874,6 +861,7 @@ const handleClick = async (tab?: any) => {
|
||||
tableLoading.value = false
|
||||
}, 1500)
|
||||
})
|
||||
})
|
||||
}
|
||||
//查询趋势数据
|
||||
if (dataSet.value.includes('_trenddata')) {
|
||||
|
||||
@@ -40,32 +40,19 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, defineProps, defineExpose, onBeforeUnmount, inject } from 'vue'
|
||||
import { ref, onMounted, defineExpose, onBeforeUnmount, inject } from 'vue'
|
||||
import { getMakeUpData, getAskDirOrFile, offlineDataUploadMakeUp } from '@/api/cs-harmonic-boot/recruitment.ts'
|
||||
import DatePicker from '@/components/form/datePicker/index.vue'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import {
|
||||
Plus,
|
||||
Back,
|
||||
Search,
|
||||
Refresh,
|
||||
RefreshRight,
|
||||
RefreshLeft,
|
||||
ScaleToOriginal,
|
||||
ZoomIn,
|
||||
Setting,
|
||||
Cpu,
|
||||
View,
|
||||
Download,
|
||||
ZoomOut,
|
||||
FolderOpened
|
||||
} from '@element-plus/icons-vue'
|
||||
Setting} from '@element-plus/icons-vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import mqtt from 'mqtt'
|
||||
const checkList: any = ref([])
|
||||
// const props = defineProps(['lineId'])
|
||||
const { push, currentRoute, go } = useRouter() // 路由
|
||||
const { go } = useRouter() // 路由
|
||||
|
||||
const loading = ref(false)
|
||||
const dirList = ref([])
|
||||
@@ -111,7 +98,6 @@ const handleUpDevice = () => {
|
||||
ndid: routes.query.ndid,
|
||||
proList: proList
|
||||
}
|
||||
// loading.value = true
|
||||
offlineDataUploadMakeUp(form)
|
||||
.then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
@@ -119,26 +105,10 @@ const handleUpDevice = () => {
|
||||
// loading.value = false
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
.catch(() => {
|
||||
// loading.value = false
|
||||
})
|
||||
}
|
||||
const handleIntoDir = (row: any) => {
|
||||
if (dirCheckedList.value.indexOf(row) == -1) {
|
||||
dirCheckedList.value.push(row)
|
||||
}
|
||||
console.log(row, 'hhhhh', dirCheckedList.value)
|
||||
const obj = {
|
||||
fileType: row.type,
|
||||
nDid: route.value.ndid,
|
||||
path: row.prjDataPath,
|
||||
prjName: row.prjName
|
||||
}
|
||||
getAskDirOrFile(obj).then(res => {
|
||||
dirList.value = res.data
|
||||
console.log(dirList.value, '查询3333333333333333')
|
||||
})
|
||||
}
|
||||
|
||||
const mqttRef = ref()
|
||||
const url: any = inject('MQTTURL')
|
||||
@@ -160,7 +130,7 @@ const connectMqtt = () => {
|
||||
mqttRef.value = mqtt.connect(url, options)
|
||||
}
|
||||
connectMqtt()
|
||||
mqttRef.value.on('connect', (e: any) => {
|
||||
mqttRef.value.on('connect', () => {
|
||||
// ElMessage.success('连接mqtt服务器成功!')
|
||||
console.log('mqtt客户端已连接....')
|
||||
// mqttRef.value.subscribe('/Web/Progress')
|
||||
@@ -168,22 +138,17 @@ mqttRef.value.on('connect', (e: any) => {
|
||||
mqttRef.value.subscribe('/dataOnlineRecruitment/Progress/' + route.value.id)
|
||||
})
|
||||
const mqttMessage = ref<any>({})
|
||||
const status: any = ref()
|
||||
mqttRef.value.on('message', (topic: any, message: any) => {
|
||||
// console.log('🚀 ~ mqttRef.value.on ~ message:', JSON.parse(message))
|
||||
// console.log('mqtt接收到消息', message,topic)
|
||||
console.log('mqtt接收到消息', JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message)))))
|
||||
loading.value = false
|
||||
// "{allStep:\""+times+"\",nowStep:"+i+"}"
|
||||
let str = JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
|
||||
// eval('(' + str + ')').includes('fileName')
|
||||
let regex1 = /allStep:(.*?),nowStep/
|
||||
let regex2 = /nowStep:(.*?)}/
|
||||
mqttMessage.value = {
|
||||
allStep: str.match(regex1)[1],
|
||||
nowStep: str.match(regex2)[1]
|
||||
}
|
||||
console.log(mqttMessage.value, '=============================================185')
|
||||
console.log(mqttMessage.value)
|
||||
let checkedList = tableRef.value.getCheckboxRecords().map((item: any) => {
|
||||
return item.name
|
||||
})
|
||||
@@ -194,10 +159,6 @@ mqttRef.value.on('message', (topic: any, message: any) => {
|
||||
}
|
||||
})
|
||||
})
|
||||
// status.value = parseInt(Number((mqttMessage.value.nowStep / mqttMessage.value.allStep) * 100))
|
||||
// if (status.value == 100) {
|
||||
// status.value = 99
|
||||
// }
|
||||
})
|
||||
|
||||
mqttRef.value.on('error', (error: any) => {
|
||||
@@ -209,8 +170,6 @@ mqttRef.value.on('close', function () {
|
||||
console.log('mqtt客户端已断开连接.....')
|
||||
})
|
||||
onMounted(() => {
|
||||
console.log()
|
||||
// getMakeUpDataList()
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
if (mqttRef.value) {
|
||||
@@ -220,40 +179,6 @@ onBeforeUnmount(() => {
|
||||
defineExpose({ getMakeUpDataList })
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
// .current_device {
|
||||
// width: 100%;
|
||||
// height: calc(100vh - 200px);
|
||||
// display: flex;
|
||||
// flex-wrap: wrap;
|
||||
// align-items: flex-start;
|
||||
// // justify-content: space-between;
|
||||
// overflow-y: auto;
|
||||
// .device_dir {
|
||||
// width: 24.1%;
|
||||
// height: 120px;
|
||||
// border: 1px solid #eee;
|
||||
// margin: 0 0.3%;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// flex-direction: column;
|
||||
// justify-content: center;
|
||||
// .device_dir_file {
|
||||
// width: 60px;
|
||||
// height: 60px;
|
||||
// }
|
||||
// img {
|
||||
// width: 50px;
|
||||
// height: 50px;
|
||||
// }
|
||||
// img:hover {
|
||||
// cursor: pointer;
|
||||
// }
|
||||
// p {
|
||||
// margin-top: 10px;
|
||||
// }
|
||||
// // margin:10px;
|
||||
// }
|
||||
// }
|
||||
.current_device {
|
||||
width: 100%;
|
||||
height: calc(100vh - 200px);
|
||||
|
||||
@@ -22,9 +22,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, watch } from 'vue'
|
||||
import { ref, onMounted } from 'vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getDeviceHarmonicSpectrumData } from '@/api/cs-device-boot/EquipmentDelivery.ts'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { yMethod } from '@/utils/echartMethod'
|
||||
const searchForm: any = ref({})
|
||||
|
||||
@@ -158,7 +158,6 @@
|
||||
import { ref, onMounted } from 'vue'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import { getRealTimeTableList } from '@/api/cs-device-boot/EquipmentDelivery'
|
||||
import * as echarts from 'echarts'
|
||||
const pieChartRef: any = ref()
|
||||
const pieChart1: any = ref()
|
||||
const pieChart2: any = ref()
|
||||
|
||||
@@ -56,9 +56,6 @@
|
||||
<div class="upload_progress" v-if="status != 0 && status != 100 && changeType == 'upload'">
|
||||
正在上传:{{ fileName }}
|
||||
<el-progress :percentage="status" />
|
||||
<!-- <el-progress :percentage="30" :indeterminate="true">
|
||||
<el-button text>上传中...</el-button>
|
||||
</el-progress> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- 以列表形式展示 -->
|
||||
@@ -196,35 +193,20 @@
|
||||
<script setup lang="ts">
|
||||
import DeviceTree from '@/components/tree/govern/deviceTree.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { ref, reactive, watch, onMounted, onBeforeUnmount, h, inject } from 'vue'
|
||||
import { ref, watch, onMounted, onBeforeUnmount, h, inject } from 'vue'
|
||||
import { ElMessage, ElMessageBox, ElInput } from 'element-plus'
|
||||
import {
|
||||
getDeviceRootPath,
|
||||
getFileServiceFileOrDir,
|
||||
downLoadDeviceFile,
|
||||
uploadDeviceFile,
|
||||
reStartDevice,
|
||||
addDeviceDir,
|
||||
delDeviceDir
|
||||
} from '@/api/cs-device-boot/fileService.ts'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import {
|
||||
CirclePlus,
|
||||
Delete,
|
||||
EditPen,
|
||||
ArrowLeft,
|
||||
ArrowRight,
|
||||
Download,
|
||||
Upload,
|
||||
View,
|
||||
Check,
|
||||
Plus,
|
||||
Refresh,
|
||||
Search
|
||||
} from '@element-plus/icons-vue'
|
||||
import { Delete, Download, Upload, Plus, Refresh, Search } from '@element-plus/icons-vue'
|
||||
import popup from './popup.vue'
|
||||
import mqtt from 'mqtt'
|
||||
import { passwordConfirm, updatePassword } from '@/api/user-boot/user'
|
||||
import { passwordConfirm } from '@/api/user-boot/user'
|
||||
defineOptions({
|
||||
name: 'govern/device/fileService'
|
||||
})
|
||||
@@ -234,8 +216,6 @@ const tableHeight = mainHeight(130)
|
||||
const loading = ref(false)
|
||||
//nDid
|
||||
const nDid = ref<string>('')
|
||||
// 树节点点击
|
||||
|
||||
//当前目录
|
||||
const activePath = ref<string>('')
|
||||
//判断是否是根目录
|
||||
@@ -243,7 +223,6 @@ const isRoot = ref<boolean>(true)
|
||||
//储存所有点击过的目录
|
||||
const activePathList: any = ref([])
|
||||
const nodeClick = (e: any) => {
|
||||
console.log(e, '------')
|
||||
if (e && (e.level == 2 || e.type == 'device')) {
|
||||
loading.value = true
|
||||
nDid.value = e.ndid
|
||||
@@ -476,7 +455,6 @@ const submitDeviceDir = () => {
|
||||
addDeviceDir(obj).then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
reloadCurrentMenu(res.message)
|
||||
// ElMessage({ message: res.message, type: 'success', duration: 5000 })
|
||||
addDeviceDirOpen.value = false
|
||||
}
|
||||
})
|
||||
@@ -485,13 +463,6 @@ const submitDeviceDir = () => {
|
||||
}
|
||||
//删除文件夹或文件
|
||||
const handleDelDirOrFile = (row: any) => {
|
||||
// delDeviceDir({ nDid: nDid.value, path: row.prjDataPath }).then((res: any) => {
|
||||
// if (res.code == 'A0000') {
|
||||
// reloadCurrentMenu(res.message)
|
||||
// // ElMessage({ message: res.message, type: 'success', duration: 5000 })
|
||||
// }
|
||||
// })
|
||||
|
||||
ElMessageBox.prompt('二次校验密码确认', '删除', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
@@ -596,12 +567,8 @@ const mqttMessage = ref<any>({})
|
||||
const status: any = ref()
|
||||
|
||||
mqttRef.value.on('message', (topic: any, message: any) => {
|
||||
// console.log('🚀 ~ mqttRef.value.on ~ message:', JSON.parse(message))
|
||||
// console.log('mqtt接收到消息', message,topic)
|
||||
console.log('mqtt接收到消息', JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message)))))
|
||||
// "{allStep:\""+times+"\",nowStep:"+i+"}"
|
||||
let str = JSON.parse(JSON.stringify(JSON.parse(new TextDecoder().decode(message))))
|
||||
// eval('(' + str + ')').includes('fileName')
|
||||
let regex = /fileName:(.*?),allStep/
|
||||
let regex1 = /allStep:(.*?),nowStep/
|
||||
let regex2 = /nowStep:(.*?)}/
|
||||
@@ -610,7 +577,6 @@ mqttRef.value.on('message', (topic: any, message: any) => {
|
||||
allStep: str.match(regex1)[1],
|
||||
nowStep: str.match(regex2)[1]
|
||||
}
|
||||
console.log(mqttMessage.value, '?????????')
|
||||
status.value = parseInt(Number((mqttMessage.value.nowStep / mqttMessage.value.allStep) * 100))
|
||||
fileRef.value.setStatus(mqttMessage.value)
|
||||
fileName.value = mqttMessage.value.fileName
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, defineExpose, defineProps, onBeforeUnmount, onUnmounted, defineEmits, watch } from 'vue'
|
||||
import { ref, onMounted, defineExpose, onUnmounted, defineEmits } from 'vue'
|
||||
import {
|
||||
getFileServiceFileOrDir,
|
||||
downLoadDeviceFile,
|
||||
@@ -111,8 +111,6 @@ const handleDownLoad = () => {
|
||||
downLoadDeviceFile(obj)
|
||||
.then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
console.log(res, '00000')
|
||||
|
||||
// downLoadFile(res.data).then((resp: any) => {
|
||||
// if (resp.type != 'application/json') {
|
||||
// // 'application/vnd.ms-excel'
|
||||
@@ -158,7 +156,6 @@ const setStatus = (val: any) => {
|
||||
downLoading.value=true
|
||||
if (status.value == 100) {
|
||||
downLoadDeviceFilePath({ nDid: fileData.value.nDid, name: fileData.value.prjDataPath }).then((ress: any) => {
|
||||
console.log(ress, 'a7778888881111')
|
||||
if (ress.code == 'A0000') {
|
||||
downLoadFile(ress.data).then((resp: any) => {
|
||||
if (resp.type != 'application/json') {
|
||||
|
||||
@@ -80,7 +80,7 @@ import { queryByCode, queryByid, queryCsDictTree } from '@/api/system-boot/dictT
|
||||
import { getDeviceData } from '@/api/cs-device-boot/EquipmentDelivery'
|
||||
import { getTargetById } from '@/api/cs-device-boot/csDataArray'
|
||||
import { getGroup } from '@/api/cs-device-boot/csGroup'
|
||||
import { ref, reactive } from 'vue'
|
||||
import { ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
const pageHeight = mainHeight(20)
|
||||
@@ -107,8 +107,6 @@ const nodeClick = (e: anyObj) => {
|
||||
loading.value = false
|
||||
return
|
||||
}
|
||||
console.log(deviceType.value,"++++++++++11111");
|
||||
// console.log(e.level,e.id);
|
||||
if (e.level == 2) {
|
||||
loading.value = true
|
||||
getDeviceData(e.id, 'rt','').then((res: any) => {
|
||||
|
||||
@@ -81,7 +81,6 @@ const submit = () => {
|
||||
})
|
||||
}
|
||||
const deleteGroup = (node: any) => {
|
||||
console.log(node)
|
||||
if (node.data.children && node.data.children.length > 0) {
|
||||
ElMessage.error('该分组下有指标,不能删除')
|
||||
return
|
||||
|
||||
@@ -1,268 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="cn-operate-dialog device-manage-popup"
|
||||
v-model="dialogVisible"
|
||||
:title="!addFlag ? '数据绑定' : '数据选择'"
|
||||
draggable
|
||||
:append-to-body="true"
|
||||
width="80%"
|
||||
>
|
||||
<el-button type="primary" @click="addFlag = true" v-if="!addFlag">新增</el-button>
|
||||
<el-popconfirm
|
||||
confirm-button-text="是"
|
||||
cancel-button-text="否"
|
||||
icon-color="#626AEF"
|
||||
width="200"
|
||||
title="是否确认删除所选数据?"
|
||||
@confirm="handleDelete('')"
|
||||
@cancel="cancelDelete"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="danger" :disabled="checkedList.length == 0" v-if="!addFlag">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
|
||||
<div class="device-manage" v-show="addFlag" v-loading="loading">
|
||||
<deviceInfoTree
|
||||
:showCheckbox="true"
|
||||
:default-checked-keys="defaultCheckedKeys"
|
||||
@checkChange="checkChange"
|
||||
ref="deviceInfoTreeRef"
|
||||
></deviceInfoTree>
|
||||
<div class="device-manage-right">
|
||||
<TableHeader datePicker ref="TableHeaderRef"></TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="device-manage" v-show="!addFlag" v-loading="loading">
|
||||
<div class="device-manage-right">
|
||||
<!-- <datePicker ref="datePickerRef"></datePicker>
|
||||
<el-button type="primary" @click="handleSearch">查询</el-button> -->
|
||||
<vxe-table
|
||||
v-bind="defaultAttribute"
|
||||
:data="tableData"
|
||||
height="420"
|
||||
style="width: 100%; margin-top: 10px"
|
||||
ref="checkedTableRef"
|
||||
@checkbox-all="selectChangeEvent"
|
||||
@checkbox-change="selectChangeEvent"
|
||||
>
|
||||
<vxe-column type="checkbox" width="60"></vxe-column>
|
||||
<vxe-column field="devName" title="设备名称"></vxe-column>
|
||||
<vxe-column field="devMac" title="设备MAC"></vxe-column>
|
||||
<vxe-column field="devNdId" title="网络设备ID"></vxe-column>
|
||||
<vxe-column field="lineName" title="线路号"></vxe-column>
|
||||
<vxe-column field="startTime" title="开始时间"></vxe-column>
|
||||
<vxe-column field="endTime" title="结束时间"></vxe-column>
|
||||
<vxe-column title="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-popconfirm
|
||||
width="150"
|
||||
confirm-button-text="是"
|
||||
cancel-button-text="否"
|
||||
icon-color="#626AEF"
|
||||
title="是否确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
@cancel="cancelDelete"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button type="danger" text >删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer="">
|
||||
<el-button @click="close">取 消</el-button>
|
||||
<el-button type="primary" @click="submit" v-if="addFlag">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import deviceInfoTree from '@/components/tree/govern/deviceInfoTree.vue'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import { ref, onMounted, provide, watch } from 'vue'
|
||||
import { getDeviceList, addDevice, delDevice } from '@/api/cs-device-boot/planData'
|
||||
import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
const pageHeight = mainHeight(-20)
|
||||
const loading = ref(false)
|
||||
const defaultCheckedKeys: any = ref([])
|
||||
const tableData = ref([])
|
||||
defineOptions({
|
||||
name: 'govern/tourist/index'
|
||||
})
|
||||
const treeIds: any = ref([])
|
||||
//树节点选择变化的时候处理树节点选中数据
|
||||
const checkChange = async (data: any) => {
|
||||
if (data.checked) {
|
||||
defaultCheckedKeys.value.push(data.data.id)
|
||||
data.data.children?.map((item: any) => {
|
||||
treeIds.value.push(item.id)
|
||||
})
|
||||
} else {
|
||||
defaultCheckedKeys.value.splice(defaultCheckedKeys.value.indexOf(data.data.id), 1)
|
||||
data.data.children?.map((item: any) => {
|
||||
treeIds.value.splice(defaultCheckedKeys.value.indexOf(item.id), 1)
|
||||
})
|
||||
}
|
||||
// await tableStore.index()
|
||||
}
|
||||
const datePickerRef = ref()
|
||||
const handleSearch = () => {
|
||||
console.log(datePickerRef.value.timeValue)
|
||||
}
|
||||
const dialogVisible = ref(false)
|
||||
const deviceInfoTreeRef = ref()
|
||||
//判断是否显示新增页面 false显示详情页面和删除按钮隐藏确定按钮 true显示新增页面与确定按钮隐藏删除按钮
|
||||
const addFlag = ref(false)
|
||||
const selectId: any = ref('')
|
||||
//查绑定测试项列表
|
||||
const getSelectedTable = (id: any) => {
|
||||
//新增传0已绑定传1
|
||||
getDeviceList({ id: id, isTrueFlag: 1, pageNum: 1, pageSize: 1000 }).then(res => {
|
||||
tableData.value = res.data.records
|
||||
})
|
||||
}
|
||||
//新增设备列表
|
||||
const tableStore = new TableStore({
|
||||
url: '/cs-device-boot/wlRecord/queryPage',
|
||||
publicHeight: 210,
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ width: '60', type: 'checkbox', fixed: 'left' },
|
||||
{ title: '序号', type: 'seq', width: 80 },
|
||||
{ field: 'devName', title: '设备名称', minWidth: 170 },
|
||||
{ field: 'lineName', title: '线路号', minWidth: 170 },
|
||||
{ field: 'startTime', title: '开始时间', minWidth: 170 },
|
||||
{ field: 'endTime', title: '结束时间', minWidth: 170 }
|
||||
],
|
||||
|
||||
beforeSearchFun: () => {
|
||||
tableStore.table.params.id = selectId.value
|
||||
//新增传0已绑定传1
|
||||
tableStore.table.params.isTrueFlag = 0
|
||||
tableStore.table.params.treeIds = treeIds.value
|
||||
}
|
||||
})
|
||||
provide('tableStore', tableStore)
|
||||
//弹框打开处理
|
||||
const open = (id: any) => {
|
||||
dialogVisible.value = true
|
||||
selectId.value = id
|
||||
//1 列表 0树
|
||||
//获取树形数据
|
||||
getDeviceList({ id: id, isTrueFlag: 0 }).then(res => {
|
||||
deviceInfoTreeRef.value.getTreeList(res.data)
|
||||
})
|
||||
//查绑定测试项列表
|
||||
getSelectedTable(id)
|
||||
//查新增列表
|
||||
tableStore.index()
|
||||
}
|
||||
const tableRef = ref()
|
||||
//添加设备
|
||||
const submit = () => {
|
||||
//选择的数据
|
||||
let deviceIds = []
|
||||
//新增的时候执行的逻辑
|
||||
if (addFlag.value) {
|
||||
if (tableStore.table.selection.length != 0) {
|
||||
tableStore.table.selection.map(item => {
|
||||
deviceIds.push(item.id)
|
||||
})
|
||||
const addForm = {
|
||||
id: selectId.value,
|
||||
list: deviceIds
|
||||
}
|
||||
addDevice(addForm).then(res => {
|
||||
if (res.code == 'A0000') {
|
||||
ElMessage.success('添加成功')
|
||||
getSelectedTable(selectId.value)
|
||||
//清除树节点选择状态
|
||||
defaultCheckedKeys.value = []
|
||||
//刷新新增列表状态
|
||||
tableStore.index()
|
||||
addFlag.value = false
|
||||
}
|
||||
})
|
||||
} else {
|
||||
ElMessage.warning('请选择设备信息')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const close = () => {
|
||||
if (addFlag.value) {
|
||||
addFlag.value = false
|
||||
checkedList.value = []
|
||||
checkedTableRef.value.clearCheckboxRow()
|
||||
} else {
|
||||
dialogVisible.value = false
|
||||
}
|
||||
}
|
||||
//删除设备
|
||||
const checkedTableRef = ref()
|
||||
//判断是否选择了设备数据
|
||||
const checkedList: any = ref([])
|
||||
/*
|
||||
* 记录选择的项
|
||||
*/
|
||||
const selectChangeEvent = (checked: any) => {
|
||||
checkedList.value = checkedTableRef.value.getCheckboxRecords()
|
||||
}
|
||||
|
||||
const handleDelete = (row: any) => {
|
||||
let list = []
|
||||
//单选删除
|
||||
if (row) {
|
||||
list.push(row.id)
|
||||
}
|
||||
//批量删除
|
||||
else {
|
||||
checkedTableRef.value.getCheckboxRecords().length != 0
|
||||
? checkedTableRef.value.getCheckboxRecords().map((item: any) => {
|
||||
list.push(item.id)
|
||||
})
|
||||
: (list = [])
|
||||
}
|
||||
if (list.length != 0) {
|
||||
delDevice({ id: selectId.value, list: list }).then(res => {
|
||||
if (res.code == 'A0000') {
|
||||
ElMessage.success('删除成功')
|
||||
getSelectedTable(selectId.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
const cancelDelete = () => {
|
||||
console.log('取消')
|
||||
}
|
||||
onMounted(() => {})
|
||||
defineExpose({ open })
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.device-manage {
|
||||
display: flex;
|
||||
|
||||
&-right {
|
||||
overflow: hidden;
|
||||
flex: 1;
|
||||
padding: 10px 10px 10px 0;
|
||||
.el-descriptions__header {
|
||||
height: 36px;
|
||||
margin-bottom: 7px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ::v-deep .el-
|
||||
</style>
|
||||
@@ -178,10 +178,9 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, inject, defineEmits, provide, nextTick, watch, onMounted } from 'vue'
|
||||
import { ref, defineEmits } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Plus, Minus, Message, ArrowRight, ArrowLeft } from '@element-plus/icons-vue'
|
||||
import { addPlan, addRecord, updateRecord, getDeviceList, addDevice, delDevice } from '@/api/cs-device-boot/planData'
|
||||
import { addPlan, addRecord, updateRecord, getDeviceList } from '@/api/cs-device-boot/planData'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import TreeTransfers from './treeTransfers.vue'
|
||||
const dictData = useDictData()
|
||||
@@ -279,7 +278,6 @@ const changeVoltageLevel = async () => {
|
||||
}
|
||||
|
||||
//PT变比 电压<0.48kv 1:1 电压>0.48 *1000/100
|
||||
console.log(value,"999");
|
||||
if (Number(value) <= 0.48) {
|
||||
form1.value.pt = 1
|
||||
form1.value.pt1 = 1
|
||||
@@ -410,7 +408,6 @@ const detailsType = (val: any) => {
|
||||
}
|
||||
//回显方案、测试项操作
|
||||
const details = (val: any) => {
|
||||
console.log(val, '88888')
|
||||
if (val) {
|
||||
form.value = {
|
||||
describe: val.describe,
|
||||
@@ -421,23 +418,6 @@ const details = (val: any) => {
|
||||
form1.value = val
|
||||
checkedIdList.value = form1.value.list
|
||||
}
|
||||
|
||||
return
|
||||
//修改方案回显
|
||||
if (popupType.value == 1) {
|
||||
form.value = JSON.parse(JSON.stringify(val))
|
||||
}
|
||||
//修改测试项回显
|
||||
if (popupType.value == 3) {
|
||||
if (val.records[0] && val.records.length != 0) {
|
||||
form1.value = JSON.parse(JSON.stringify(val.records[0]))
|
||||
} else {
|
||||
initForm()
|
||||
}
|
||||
}
|
||||
if (popupType.value != 1 && popupType.value != 3) {
|
||||
initForm()
|
||||
}
|
||||
}
|
||||
//未绑定数据tree
|
||||
const unBindList = ref([])
|
||||
@@ -566,9 +546,6 @@ const submit = () => {
|
||||
id: planId.value,
|
||||
records: [form1.value]
|
||||
}
|
||||
// subForm.list = tableData.value.map(item => {
|
||||
// return item.id
|
||||
// })
|
||||
subForm.records[0].list = checkedIdList.value
|
||||
addRecord(subForm).then(res => {
|
||||
ElMessage.success('新增测试项成功')
|
||||
@@ -591,23 +568,6 @@ const submit = () => {
|
||||
close()
|
||||
}
|
||||
})
|
||||
return
|
||||
ruleFormRef2.value.validate((valid: any) => {
|
||||
if (valid) {
|
||||
let subForm = JSON.parse(JSON.stringify(form1.value))
|
||||
subForm.list = checkedIdList.value
|
||||
updateRecord(subForm).then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
ElMessage.success('修改测试项成功')
|
||||
initForm()
|
||||
emit('onSubmit')
|
||||
close()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log('校验不通过')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
defineExpose({ open, details, detailsType })
|
||||
@@ -632,7 +592,6 @@ defineExpose({ open, details, detailsType })
|
||||
.device_info {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
// justify-content: space-between;
|
||||
|
||||
.left_device,
|
||||
.right_device {
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, watch, defineProps, defineEmits, inject, onMounted } from 'vue'
|
||||
import { ref, nextTick, watch, defineProps, defineEmits } from 'vue'
|
||||
import { getSchemeTree, getTestRecordInfo } from '@/api/cs-device-boot/planData'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import useCurrentInstance from '@/utils/useCurrentInstance'
|
||||
|
||||
@@ -36,8 +36,6 @@
|
||||
</div>
|
||||
<!-- 中间穿梭按钮 -->
|
||||
<div class="transferBtn">
|
||||
<!-- <div class="pickBtn">>></div>
|
||||
<div class="pickBtn"><<</div> -->
|
||||
<el-button type="primary" @click="towardsRight">
|
||||
绑定
|
||||
<el-icon><ArrowRight /></el-icon>
|
||||
|
||||
@@ -41,10 +41,18 @@
|
||||
<el-input v-model="form.type" autocomplete="off" placeholder="请输入基础数据类型"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始结束次数:" prop="harmStart">
|
||||
<el-slider v-model="form.harm" range show-stops :max="50" style="width: 95%"/>
|
||||
<el-slider v-model="form.harm" range show-stops :max="50" style="width: 95%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="统计方法:" prop="statMethod">
|
||||
<el-select v-model="form.statMethod" multiple filterable clearable placeholder="请选择统计方法">
|
||||
<el-select
|
||||
v-model="form.statMethod"
|
||||
multiple
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择统计方法"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in StatMethodSelect"
|
||||
:key="item.id"
|
||||
|
||||
Reference in New Issue
Block a user