修改现场反馈问题
This commit is contained in:
@@ -10,8 +10,8 @@ import useSetTheme from '@/utils/setTheme'
|
||||
import { provide, onMounted, ref } from 'vue'
|
||||
//线上mqtt
|
||||
|
||||
let buildUrl = 'wss://pqmcn.com:8087/mqtt'//102
|
||||
// let buildUrl = 'ws://pqmcn.com:8073/mqtt'//27
|
||||
// let buildUrl = 'wss://pqmcn.com:8087/mqtt'//102
|
||||
let buildUrl = 'ws://pqmcn.com:8073/mqtt'//27
|
||||
|
||||
|
||||
// 从 Nginx 获取 MQTT URL
|
||||
|
||||
@@ -15,7 +15,7 @@ export const dicDelete = (id: string) => {
|
||||
|
||||
export function dicAdd(data: any) {
|
||||
return createAxios({
|
||||
url: '/system-boot/dictTree//add',
|
||||
url: '/system-boot/dictTree/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -23,8 +23,8 @@ export function dicAdd(data: any) {
|
||||
|
||||
export function dicUpdate(data: any) {
|
||||
return createAxios({
|
||||
url: '/system-boot/dictTree//update',
|
||||
url: '/system-boot/dictTree/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ export const getDictTreeById = (id: any) => {
|
||||
return createAxios({
|
||||
url: '/system-boot/dictTree/queryById',
|
||||
method: 'POST',
|
||||
data:form
|
||||
data: form
|
||||
})
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ export const addDictTree = (data: any) => {
|
||||
// 编辑统计指标配置项
|
||||
export const updateStatistical = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/system-boot/dictTree//update',
|
||||
url: '/system-boot/dictTree/update',
|
||||
method: 'PUT',
|
||||
data: data
|
||||
})
|
||||
@@ -88,7 +88,7 @@ export const updateStatistical = (data: any) => {
|
||||
// 单位绑定
|
||||
export function codeDicTree(data: any) {
|
||||
return createAxios({
|
||||
url: '/system-boot/dictTree//codeDicTree',
|
||||
url: '/system-boot/dictTree/codeDicTree',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
|
||||
@@ -98,10 +98,10 @@ watch(
|
||||
() => tableStore.table.allFlag,
|
||||
newVal => {
|
||||
if (tableStore.table.allFlag) {
|
||||
console.log("🚀 ~ tableStore.table:", tableStore.table)
|
||||
console.log("🚀 ~ tableStore.table:", tableStore.exportName || document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '')
|
||||
|
||||
tableRef.value?.exportData({
|
||||
filename: tableStore.table.exportName || document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '', // 文件名字
|
||||
filename: tableStore.exportName || document.querySelectorAll('.ba-nav-tab.active')[0].textContent || '', // 文件名字
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||
useStyle: true,
|
||||
|
||||
@@ -36,6 +36,7 @@ const apiList = ref([])
|
||||
const tableStore = new TableStore({
|
||||
showPage: false,
|
||||
url: '/user-boot/function/getButtonById',
|
||||
publicHeight: 60,
|
||||
column: [
|
||||
{ title: '普通接口/接口名称', field: 'name' },
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ const popupRef = ref()
|
||||
const tableStore = new TableStore({
|
||||
showPage: false,
|
||||
url: '/user-boot/function/functionTree',
|
||||
publicHeight: 60,
|
||||
column: [
|
||||
{ title: '菜单名称', field: 'title', align: 'left', treeNode: true },
|
||||
{
|
||||
|
||||
@@ -77,6 +77,7 @@ const rankOptions = ref([
|
||||
const tableStore = new TableStore({
|
||||
url: '/zl-event-boot/csDevErrEvt/list',
|
||||
method: 'POST',
|
||||
exportName: '异常事件',
|
||||
publicHeight: 65,
|
||||
column: [
|
||||
{ title: '设备名称', field: 'ndid', align: 'center' },
|
||||
|
||||
@@ -66,6 +66,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' },
|
||||
|
||||
@@ -108,6 +108,7 @@ const tableStore = new TableStore({
|
||||
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
|
||||
method: 'POST',
|
||||
publicHeight: 65,
|
||||
exportName: '暂态事件',
|
||||
column: [
|
||||
{ title: '设备名称', field: 'equipmentName', align: 'center' },
|
||||
{ title: '工程名称', field: 'engineeringName', align: 'center' },
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
:value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item v-if="!dataSet.includes('_items')">
|
||||
<!-- <el-select style="min-width: 120px !important" v-model.trim="formInline.dataLevel"
|
||||
:disabled="dataLevel == 'Primary' && deviceType == '0'">
|
||||
@@ -531,6 +531,7 @@ const handleTrend = async () => {
|
||||
ElMessage.success('装置应答成功')
|
||||
//每隔30s调用一下接口,通知后台推送mqtt消息
|
||||
trendTimer.value = window.setInterval(() => {
|
||||
if (!dataSet.value.includes('_realtimedata')) return
|
||||
getHarmRealData(lineId.value, activeTrendName.value).then((res: any) => {
|
||||
// console.log(res, '获取谐波频谱数据')
|
||||
})
|
||||
@@ -587,6 +588,8 @@ const handleHarmonicSpectrum = async () => {
|
||||
// mqttMessage.value = {}
|
||||
|
||||
realDataTimer.value = window.setInterval(() => {
|
||||
if (!dataSet.value.includes('_realtimedata')) return
|
||||
|
||||
getBasicRealData(lineId.value).then((res: any) => {
|
||||
// console.log(res, '获取基础实时数据')
|
||||
})
|
||||
@@ -612,6 +615,7 @@ const handleReturn = async () => {
|
||||
ElMessage.success('装置应答成功')
|
||||
// mqttMessage.value = {}
|
||||
realDataTimer.value = window.setInterval(() => {
|
||||
if (!dataSet.value.includes('_realtimedata')) return
|
||||
getBasicRealData(lineId.value).then((res: any) => {
|
||||
// console.log(res, '获取基础实时数据')
|
||||
})
|
||||
@@ -826,6 +830,7 @@ const getRealDataMqttMsg = async () => {
|
||||
mqttMessage.value = {}
|
||||
|
||||
realDataTimer.value = window.setInterval(async () => {
|
||||
if (!dataSet.value.includes('_realtimedata')) return
|
||||
await getBasicRealData(lineId.value).then((res: any) => {
|
||||
// console.log(res, '获取基础实时数据')
|
||||
})
|
||||
|
||||
@@ -484,9 +484,11 @@ const submit = () => {
|
||||
if (popupType.value == 3 || popupType.value == 4) {
|
||||
let subForm = JSON.parse(JSON.stringify(form1.value))
|
||||
subForm.list = checkedIdList.value
|
||||
console.log(title.value.includes('绑定测试项'));
|
||||
|
||||
updateRecord(subForm).then((res: any) => {
|
||||
if (res.code == 'A0000') {
|
||||
ElMessage.success('修改测试项成功')
|
||||
ElMessage.success(title.value.includes('绑定测试项')?'绑定测试项成功':'修改测试项成功')
|
||||
initForm()
|
||||
emit('onSubmit')
|
||||
close()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<el-option v-for="item in TypeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select> -->
|
||||
<el-select v-model.trim="form.type" placeholder="请选择" @change="formDevTypeChange" clearable>
|
||||
<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>
|
||||
@@ -17,22 +17,22 @@
|
||||
<el-option v-for="item in DevTypeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
</el-select> -->
|
||||
<el-select v-model.trim="form.devType" filterable placeholder="请选择" clearable>
|
||||
<el-select v-model.trim="form.devType" filterable placeholder="请选择装置型号" clearable @change="devTypeChange">
|
||||
<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>
|
||||
placeholder="请输入版本号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本类型:" >
|
||||
<el-form-item label="版本类型:" prop="versionType">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.versionType" autocomplete="off"
|
||||
placeholder="填写特殊类型(不填默认通用类型)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本协议:" prop="versionAgreement">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.versionAgreement" autocomplete="off"
|
||||
placeholder="请输入"></el-input>
|
||||
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"
|
||||
@@ -41,17 +41,17 @@
|
||||
|
||||
<el-form-item label="CRC校验:" prop="crcInfo">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.crcInfo" autocomplete="off"
|
||||
placeholder="请输入"></el-input>
|
||||
placeholder="请输入CRC校验"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<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>
|
||||
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"
|
||||
<el-upload :limit="1" :auto-upload="false" :on-change="fileChange" :on-exceed="fileExceed" :on-remove="fileRemove"
|
||||
:file-list="fileList">
|
||||
<el-button type="primary">点击上传</el-button>
|
||||
</el-upload>
|
||||
@@ -80,7 +80,7 @@ const DevTypeOptions = ref()
|
||||
const devTypeOptions: any = ref([])
|
||||
|
||||
const devModelOptions: any = ref([])
|
||||
const fileList = ref()
|
||||
const fileList:any = ref([])
|
||||
const tableStore = inject('tableStore') as TableStore
|
||||
const formRef = ref()
|
||||
const form = reactive<any>({
|
||||
@@ -94,7 +94,7 @@ const form = reactive<any>({
|
||||
versionDate: null,
|
||||
type: null,
|
||||
id: null,
|
||||
file: null
|
||||
file: []
|
||||
})
|
||||
const rules = {
|
||||
type: [{ required: true, message: '装置类型不能为空', trigger: 'blur' }],
|
||||
@@ -117,10 +117,11 @@ const typeChange = () => {
|
||||
}
|
||||
const devTypeChange = (e: any) => {
|
||||
// console.log(e)
|
||||
form.devTypeName = DevTypeOptions.value.filter((item: any) => item.value == e)[0].label
|
||||
form.devTypeName = formDevModelOptionsFilter.value.filter((item: any) => item.value == e)[0].label
|
||||
}
|
||||
queryByCode('Device_Type').then(res => {
|
||||
queryCsDictTree(res.data.id).then(res => {
|
||||
const id = res.data.id
|
||||
queryCsDictTree(id).then(res => {
|
||||
devTypeOptions.value = res.data.map((item: any) => {
|
||||
return {
|
||||
value: item.id,
|
||||
@@ -129,7 +130,12 @@ queryByCode('Device_Type').then(res => {
|
||||
}
|
||||
})
|
||||
})
|
||||
queryByid(res.data.id).then(res => {
|
||||
queryByid(id).then(res => {
|
||||
res.data.map((item: any, index: any) => {
|
||||
if (item.pid == id) {
|
||||
res.data.splice(index, 1)
|
||||
}
|
||||
})
|
||||
devModelOptions.value = res.data.map((item: any) => {
|
||||
return {
|
||||
value: item.id,
|
||||
@@ -138,7 +144,7 @@ queryByCode('Device_Type').then(res => {
|
||||
}
|
||||
})
|
||||
})
|
||||
tableStore.index()
|
||||
// tableStore.index()
|
||||
})
|
||||
const formDevModelOptionsFilter = computed(() => {
|
||||
return devModelOptions.value.filter((item: any) => {
|
||||
@@ -157,11 +163,14 @@ const fileExceed = (e: any) => {
|
||||
|
||||
ElMessage.error('只能上传一个文件')
|
||||
}
|
||||
const fileRemove = (e: any) => {
|
||||
form.file = null
|
||||
}
|
||||
const formDevTypeChange = (e: any) => {
|
||||
if (!e) {
|
||||
return
|
||||
}
|
||||
form.devModel = ''
|
||||
// form.devModel = ''
|
||||
}
|
||||
const dialogVisible = ref(false)
|
||||
const title = ref('新增版本')
|
||||
@@ -193,6 +202,12 @@ const open = (text: string, data?: anyObj) => {
|
||||
})
|
||||
}
|
||||
const submit = () => {
|
||||
|
||||
|
||||
if(form?.file == null){
|
||||
ElMessage.warning('请上传升级文件')
|
||||
return
|
||||
}
|
||||
// console.log(formRef)
|
||||
formRef.value.validate(async (valid: boolean) => {
|
||||
// console.log(valid)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<TableHeader ref="tableHeaderRef">
|
||||
<template #select>
|
||||
<el-form-item label="装置型号:">
|
||||
<el-select v-model.trim="tableStore.table.params.devType" placeholder="请选择" clearable>
|
||||
<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-select>
|
||||
@@ -14,7 +14,7 @@
|
||||
</template>
|
||||
</TableHeader>
|
||||
<Table ref="tableRef" />
|
||||
<PopupVersion ref="popupVersionRef"></PopupVersion>
|
||||
<PopupVersion ref="popupVersionRef" v-if="showPopup"></PopupVersion>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
@@ -35,14 +35,10 @@ defineOptions({
|
||||
})
|
||||
const popupVersionRef = ref()
|
||||
const dictData = useDictData()
|
||||
const showPopup = ref(false)
|
||||
const DevTypeOptions = ref()
|
||||
const tableHeaderRef = ref()
|
||||
queryByCode('Direct_Connected_Device').then(res => {
|
||||
// console.log(res)
|
||||
queryByid(res.data.id).then(res => {
|
||||
DevTypeOptions.value = res.data
|
||||
})
|
||||
})
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/cs-device-boot/edData/queryEdDataPage',
|
||||
method: 'POST',
|
||||
@@ -53,7 +49,19 @@ const tableStore = new TableStore({
|
||||
{ title: '版本日期', field: 'versionDate' },
|
||||
{ title: '归档日期', field: 'updateTime' },
|
||||
{ title: '描述', field: 'description' },
|
||||
{ title: '状态', field: 'statusName' },
|
||||
{
|
||||
title: '状态', field: 'status', render: 'tag',
|
||||
custom: {
|
||||
1: 'error',
|
||||
0: 'success',
|
||||
|
||||
},
|
||||
replaceValue: {
|
||||
1: '禁用',
|
||||
0: '启用',
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
@@ -119,7 +127,7 @@ const tableStore = new TableStore({
|
||||
],
|
||||
loadCallback: () => {
|
||||
tableStore.table.data.forEach((item: any) => {
|
||||
item.statusName = item.status === 1 ? '禁用' : '启用'
|
||||
item.statusName = item.status == 1 ? '禁用' : '启用'
|
||||
for (let key in item) {
|
||||
if (typeof item[key] !== 'number') {
|
||||
item[key] = item[key] || '/'
|
||||
@@ -128,12 +136,30 @@ const tableStore = new TableStore({
|
||||
})
|
||||
}
|
||||
})
|
||||
queryByCode('Device_Type').then(res => {
|
||||
const id = res.data.id
|
||||
queryByid(id).then(res1 => {
|
||||
res1.data.map((item: any, index: any) => {
|
||||
if (item.pid == id) {
|
||||
res1.data.splice(index, 1)
|
||||
}
|
||||
})
|
||||
console.log("🚀 ~ res1.data.map ~ res1.data:", res1.data)
|
||||
|
||||
DevTypeOptions.value = res1.data
|
||||
|
||||
})
|
||||
})
|
||||
tableStore.table.params.devType = ''
|
||||
provide('tableStore', tableStore)
|
||||
onMounted(() => {
|
||||
|
||||
tableHeaderRef.value.onComSearch()
|
||||
})
|
||||
const addMenu = () => {
|
||||
showPopup.value = true
|
||||
setTimeout(() => {
|
||||
popupVersionRef.value.open('新增版本')
|
||||
}, 100)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
<el-form-item label="编码">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.code" placeholder="请输入编码" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="类型">
|
||||
<el-form-item label="类型" v-if="title == '新增'|| title == '编辑'">
|
||||
<el-select v-model.trim="form.type" placeholder="请选择类型">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.name" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input maxlength="32" show-word-limit v-model.trim="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
|
||||
Reference in New Issue
Block a user