云平台自测问题修改
This commit is contained in:
@@ -72,7 +72,7 @@ const initListByIds = () => {
|
||||
|
||||
const templateListData = () => {
|
||||
getTemplateList({}).then(res => {
|
||||
templateList.value = res.data.filter(item => item.name === '稳态治理报表')
|
||||
templateList.value = res.data.filter(item => item.reportForm == 4)
|
||||
if (!tableStore.table.params.tempId && templateList.value?.length > 0) {
|
||||
tableStore.table.params.tempId = templateList.value[0].id
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ const initLineList = async () => {
|
||||
cslineList({}).then(res => {
|
||||
lineList.value = res.data
|
||||
tableStore.table.params.lineId = lineList.value[0].lineId
|
||||
initCode()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -434,7 +435,6 @@ watch(
|
||||
|
||||
onMounted(async () => {
|
||||
await initLineList()
|
||||
await initCode()
|
||||
})
|
||||
|
||||
watch(
|
||||
|
||||
@@ -136,19 +136,28 @@ const tableStore = new TableStore({
|
||||
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
|
||||
method: 'POST',
|
||||
column: [
|
||||
{ title: '事件描述', field: 'showName' },
|
||||
{ title: '发生位置', field: 'evtParamPosition' },
|
||||
{ title: '持续时间(s)', field: 'evtParamTm', sortable: true },
|
||||
{ title: '事件描述', field: 'showName', minWidth: 150 },
|
||||
{ title: '发生位置', field: 'evtParamPosition', minWidth: 150 },
|
||||
{
|
||||
title: '持续时间(s)',
|
||||
field: 'evtParamTm',
|
||||
sortable: true,
|
||||
minWidth: 110,
|
||||
formatter: (row: any) => {
|
||||
return Math.floor(row.cellValue * 10000) / 100
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '暂降(聚升)幅值(%)',
|
||||
field: 'evtParamVVaDepth',
|
||||
minWidth: 150,
|
||||
formatter: (row: any) => {
|
||||
let a = row.cellValue.split('%')[0] - 0
|
||||
console.log('🚀 ~ a:', a)
|
||||
return a ? a.toFixed(2) : '/'
|
||||
}, sortable: true
|
||||
},
|
||||
sortable: true
|
||||
},
|
||||
{ title: '发生时刻', field: 'startTime', sortable: true },
|
||||
{ title: '发生时刻', field: 'startTime', sortable: true, minWidth: 180 },
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
@@ -243,12 +252,12 @@ tableStore.table.params.eventType = ''
|
||||
tableStore.table.params.location = ''
|
||||
provide('tableStore', tableStore)
|
||||
const deviceTypeChange = (val: any, obj: any) => {
|
||||
flag.value = true
|
||||
flag.value = true
|
||||
nodeClick(obj)
|
||||
}
|
||||
const nodeClick = async (e: anyObj) => {
|
||||
// console.log("🚀 ~ nodeClick ~ e:", e)
|
||||
if (e.level == 2&& flag.value) {
|
||||
if (e.level == 2 && flag.value) {
|
||||
loading.value = false
|
||||
tableStore.table.params.deviceId = e.id
|
||||
nextTick(() => {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<Table ref="tableRef" :height="`calc(45vh - 50px)`"/>
|
||||
</el-dialog>
|
||||
<popup ref="detailRef"></popup>
|
||||
<!-- 离线数据导入组件 -->
|
||||
|
||||
@@ -498,9 +498,9 @@ const range = (start: any, end: any, step: any) => {
|
||||
const colors = ['#DAA520', '#2E8B57', '#A52a2a']
|
||||
const lineStyle = [{ type: 'solid' }, { type: 'dashed' }, { type: 'dotted' }]
|
||||
|
||||
const titleList: any = ref('')
|
||||
const titleList: any = ref('(未绑定数据)')
|
||||
const init = (flag: boolean) => {
|
||||
titleList.value = ''
|
||||
titleList.value = '(未绑定数据)'
|
||||
let list: any = []
|
||||
|
||||
//颜色数组
|
||||
@@ -574,6 +574,8 @@ const init = (flag: boolean) => {
|
||||
}).then(res => {
|
||||
if (res.data.length == 0) {
|
||||
titleList.value = '(未绑定数据)'
|
||||
}else{
|
||||
titleList.value = ''
|
||||
}
|
||||
chartTitle.value = chartTitle.value + titleList.value
|
||||
})
|
||||
|
||||
@@ -23,7 +23,7 @@ const tableStore = new TableStore({
|
||||
{ title: '用户名称', field: 'userName', align: 'center', minWidth: '130' },
|
||||
{ title: '更新时间', field: 'updateTime', align: 'center', sortable: true, minWidth: '150' },
|
||||
{ title: '失败原因', field: 'failReason', align: 'center', minWidth: '200' },
|
||||
{ title: '状态', field: 'result', align: 'center', minWidth: '120' },
|
||||
{ title: '状态', field: 'result', align: 'center', minWidth: '100' },
|
||||
{ title: '登录名', field: 'loginName', align: 'center', minWidth: '120' }
|
||||
],
|
||||
|
||||
|
||||
@@ -3,19 +3,34 @@
|
||||
<TableHeader ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="模版名称">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="tableStore.table.params.name" clearable
|
||||
placeholder="请输入名称"></el-input>
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
v-model.trim="tableStore.table.params.name"
|
||||
clearable
|
||||
placeholder="请输入名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="装置型号">
|
||||
<el-select v-model.trim="tableStore.table.params.devType" placeholder="请选择" clearable>
|
||||
<el-option v-for="item in DevTypeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
<el-option
|
||||
v-for="item in DevTypeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #operation>
|
||||
<el-upload action="" class="upload-demo" :show-file-list="false" :auto-upload="false"
|
||||
:on-change="chooseFile">
|
||||
<el-upload
|
||||
action=""
|
||||
class="upload-demo"
|
||||
:accept="'.json'"
|
||||
:show-file-list="false"
|
||||
:auto-upload="false"
|
||||
:on-change="chooseFile"
|
||||
>
|
||||
<el-button :icon="Plus" type="primary" class="ml10">新增模版</el-button>
|
||||
</el-upload>
|
||||
</template>
|
||||
@@ -33,7 +48,7 @@ import { queryByCode, queryByid } from '@/api/system-boot/dictTree'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { addDevModel } from '@/api/access-boot/analyzeModel'
|
||||
import { AuditDevModel } from '@/api/cs-device-boot/devmodel'
|
||||
|
||||
import { getFileUrl, downLoadFile } from '@/api/cs-system-boot/manage'
|
||||
defineOptions({
|
||||
name: 'govern/manage/basic/template'
|
||||
})
|
||||
@@ -58,6 +73,16 @@ const tableStore = new TableStore({
|
||||
width: '180',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'productSetting',
|
||||
title: '下载模版',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-EditPen',
|
||||
render: 'basicButton',
|
||||
click: row => {
|
||||
downloadTheReport(row.filePath,row.devTypeName)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'del',
|
||||
title: '删除',
|
||||
@@ -94,14 +119,31 @@ const loading = ref(false)
|
||||
const chooseFile = (e: any) => {
|
||||
console.warn(e)
|
||||
loading.value = true
|
||||
addDevModel(e.raw).then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
addDevModel(e.raw)
|
||||
.then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
loading.value = false
|
||||
tableStore.index()
|
||||
}
|
||||
})
|
||||
.catch(e => {
|
||||
loading.value = false
|
||||
tableStore.index()
|
||||
}
|
||||
|
||||
}).catch((e) => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
// 下载报告
|
||||
const downloadTheReport = (filePath: string,name:string) => {
|
||||
downLoadFile(filePath).then(res => {
|
||||
let blob = new Blob([res], {
|
||||
type: ' application/json'
|
||||
})
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
const link = document.createElement('a') // 创建a标签
|
||||
link.href = url
|
||||
link.download = name+'.json' // 设置下载的文件名
|
||||
document.body.appendChild(link)
|
||||
link.click() //执行下载
|
||||
document.body.removeChild(link)
|
||||
ElMessage.success('下载成功')
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -128,7 +128,7 @@ defineOptions({
|
||||
const adminInfo = useAdminInfo()
|
||||
|
||||
const hasAdmin =
|
||||
adminInfo.userType.some(item => item.includes('operation_manager') || item.includes('root')) ||
|
||||
adminInfo.roleCode.some(item => item.includes('operation_manager') || item.includes('root')) ||
|
||||
adminInfo.userType == 1
|
||||
const tableRef = ref()
|
||||
const popupRef = ref()
|
||||
|
||||
@@ -112,7 +112,7 @@ const choose = (files: any) => {
|
||||
const isJPEG = files.raw.type === 'image/jpeg'
|
||||
const isPNG = files.raw.type === 'image/png'
|
||||
if (!isJPG && !isPNG && !isJPEG) {
|
||||
ElMessage.warning('上传文件只能是 JPG/PNG 格式!')
|
||||
ElMessage.warning('上传文件只能是 jpg/png 格式!')
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ onMounted(() => {
|
||||
// })
|
||||
|
||||
const stencil = (val: any) => {
|
||||
templatePolicy.value = val.filter((item: any) => item.name != '稳态治理报表')
|
||||
templatePolicy.value = val.filter((item: any) => item.reportForm != '4')
|
||||
Template.value = templatePolicy.value[0]
|
||||
reportForm.value = templatePolicy.value[0]?.reportForm
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ const initListByIds = () => {
|
||||
}
|
||||
const stencil = (val: any) => {
|
||||
console.log('🚀 ~ stencil ~ val:', val)
|
||||
templatePolicy.value = val.filter((item: any) => item.name == '稳态治理报表')
|
||||
templatePolicy.value = val.filter((item: any) => item.reportForm == '4')
|
||||
Template.value = templatePolicy.value[0]
|
||||
reportForm.value = templatePolicy.value[0]?.reportForm
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-dialog draggable :title="title" v-model.trim="formVisible" width="30%" :before-close="closeDialog">
|
||||
<el-form :model="formdata" label-width="100px" :rules="rules" ref="ruleForm">
|
||||
<el-dialog draggable :title="title" v-model.trim="formVisible" width="500px" :before-close="closeDialog">
|
||||
<el-form :model="formdata" label-width="100px" :rules="rules" ref="ruleForm" class="form-one">
|
||||
<el-form-item label="模板名称:" prop="name">
|
||||
<el-input maxlength="32" show-word-limit placeholder="模板名称" v-model.trim="formdata.name"
|
||||
style="width: 100%"></el-input>
|
||||
@@ -56,11 +56,15 @@ const reportFormList = [
|
||||
{
|
||||
value: '2',
|
||||
label: '统计报表'
|
||||
}, {
|
||||
value: '4',
|
||||
label: '治理前后对比报表'
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '自定义报表'
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
const rules = {
|
||||
name: [{ required: true, message: '请输入模板名称', trigger: 'blur' }],
|
||||
|
||||
@@ -41,7 +41,7 @@ const tableStore: any = new TableStore({
|
||||
column: [
|
||||
{ field: 'name', title: '模板名称' },
|
||||
{ field: 'reportForm', title: '模板类型',formatter: (row) => {
|
||||
return row.cellValue == 1 ? '电能质量报表类型' : row.cellValue == 2 ? '用能报表类型' : ''
|
||||
return row.cellValue == 1 ? '分析报表' : row.cellValue == 2 ? '统计报表' : row.cellValue == 3 ? '自定义报表' : '治理前后对比报表'
|
||||
} },
|
||||
{ field: 'updateBy', title: '更新用户' },
|
||||
{ field: 'createTime', title: '创建时间' , sortable: true},
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
</template>
|
||||
<template v-slot:operation>
|
||||
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">新增</el-button>
|
||||
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table
|
||||
@@ -71,7 +70,7 @@
|
||||
</span>
|
||||
<div>
|
||||
<template v-if="data.id">
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-tooltip content="编辑" placement="left">
|
||||
<el-button
|
||||
style="margin-left: 4px"
|
||||
icon="el-icon-Edit"
|
||||
@@ -82,16 +81,15 @@
|
||||
</el-tooltip>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-popconfirm title="确定重启吗?" placement="bottom" @confirm="restart(data)">
|
||||
<el-popconfirm title="确定重启吗?" placement="left" @confirm="restart(data)">
|
||||
<template #reference>
|
||||
<el-tooltip content="重启" placement="top">
|
||||
<el-button
|
||||
style="margin-left: 4px"
|
||||
icon="el-icon-Refresh"
|
||||
type="warning"
|
||||
link
|
||||
/>
|
||||
</el-tooltip>
|
||||
<el-button
|
||||
style="margin-left: 4px"
|
||||
icon="el-icon-Refresh"
|
||||
type="warning"
|
||||
link
|
||||
@click.stop
|
||||
/>
|
||||
</template>
|
||||
<template #actions="{ confirm, cancel }">
|
||||
<el-button size="small" @click="cancel">取消</el-button>
|
||||
@@ -179,12 +177,17 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 绑定进程号 -->
|
||||
<el-dialog draggable title="绑定进程号" v-model="popUps" :close-on-click-modal="false" width="400px">
|
||||
<el-form :model="bindProcessForm" ref="bindProcessFormRef" label-width="80px" :rules="rules2" >
|
||||
<el-dialog draggable title="绑定进程号" v-model="popUps" :close-on-click-modal="false" width="400px">
|
||||
<el-form :model="bindProcessForm" ref="bindProcessFormRef" label-width="80px" :rules="rules2">
|
||||
<el-form-item label="前置机" prop="nodeId">
|
||||
<el-select v-model="bindProcessForm.nodeId" placeholder="请选择前置机" style="width: 100%" clearable @change="handleNodeChange">
|
||||
<el-select
|
||||
v-model="bindProcessForm.nodeId"
|
||||
placeholder="请选择前置机"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
@change="handleNodeChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in tableStore.table.data"
|
||||
:key="item.id"
|
||||
@@ -195,7 +198,12 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="进程号" prop="processNo">
|
||||
<el-select v-model="bindProcessForm.processNo" placeholder="请选择进程号" style="width: 100%" clearable>
|
||||
<el-select
|
||||
v-model="bindProcessForm.processNo"
|
||||
placeholder="请选择进程号"
|
||||
style="width: 100%"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in processOptions"
|
||||
:key="item.name"
|
||||
@@ -211,7 +219,6 @@
|
||||
<el-button type="primary" @click="bindTheProcess">确 定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -222,7 +229,14 @@ import { ref, onMounted, provide, reactive, nextTick } from 'vue'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { ElButton } from 'element-plus'
|
||||
import {addNode,updateNode,delNode,nodeDeviceTree,restartProcess,updateProcess} from '@/api/cs-device-boot/frontManagement'
|
||||
import {
|
||||
addNode,
|
||||
updateNode,
|
||||
delNode,
|
||||
nodeDeviceTree,
|
||||
restartProcess,
|
||||
updateProcess
|
||||
} from '@/api/cs-device-boot/frontManagement'
|
||||
|
||||
defineOptions({
|
||||
name: 'govern/setting/frontManagement'
|
||||
@@ -427,7 +441,6 @@ const currentChangeEvent = () => {
|
||||
|
||||
// 重启进程
|
||||
const restart = (data: any) => {
|
||||
|
||||
restartProcess({
|
||||
nodeId: nodeId.value,
|
||||
processNo: data.processNo
|
||||
@@ -442,11 +455,10 @@ const change = (val: any) => {
|
||||
treeRef.value!.filter(filterText.value)
|
||||
}
|
||||
|
||||
|
||||
// 修改 edit 方法
|
||||
const edit = (data: any) => {
|
||||
bindProcessForm.value.processNo = data.nodeProcess
|
||||
bindProcessForm.value.nodeId = nodeId.value // 默认选中当前节点
|
||||
bindProcessForm.value.nodeId = nodeId.value // 默认选中当前节点
|
||||
processId.value = data.id
|
||||
popUps.value = true
|
||||
|
||||
@@ -466,7 +478,6 @@ const loadProcessOptionsForNode = (nodeId: string) => {
|
||||
} else {
|
||||
processOptions.value = []
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@@ -477,13 +488,12 @@ const handleNodeChange = (nodeId: any) => {
|
||||
bindProcessForm.value.processNo = ''
|
||||
return
|
||||
}
|
||||
// 清除之前选中的进程号
|
||||
// 清除之前选中的进程号
|
||||
bindProcessForm.value.processNo = ''
|
||||
// 加载新选中前置机的进程号选项
|
||||
loadProcessOptionsForNode(nodeId)
|
||||
}
|
||||
|
||||
|
||||
// 更新进程号
|
||||
const bindTheProcess = () => {
|
||||
bindProcessFormRef.value.validate((valid: any) => {
|
||||
@@ -499,8 +509,6 @@ const bindTheProcess = () => {
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
const filterNode = (value: string, data: any, node: any) => {
|
||||
if (!value) return true
|
||||
@@ -537,7 +545,6 @@ const chooseNode = (value: string, data: any, node: any) => {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
tableStore.table.params.orderBy = 'desc'
|
||||
tableStore.table.params.nodeGrade = ''
|
||||
tableStore.table.params.searchState = ''
|
||||
@@ -591,8 +598,6 @@ onMounted(() => {
|
||||
tableStore.index()
|
||||
}, 100)
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@@ -623,7 +628,6 @@ onMounted(() => {
|
||||
}
|
||||
:deep(.default) {
|
||||
display: flex;
|
||||
|
||||
}
|
||||
.custom-tree-node {
|
||||
flex: 1;
|
||||
|
||||
Reference in New Issue
Block a user