Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad02fac4ff | ||
|
|
e4de4fe43c | ||
|
|
bc7d6b24b7 | ||
|
|
3de7461960 | ||
|
|
bff94f4521 | ||
|
|
e63a3dfa92 | ||
|
|
7efb738d54 | ||
|
|
84763eb414 | ||
|
|
820a6bb233 | ||
|
|
31e44cfc69 | ||
|
|
fb9460e307 | ||
|
|
99a8c97b17 | ||
|
|
c30569f5e1 | ||
|
|
cdc19e1db9 |
@@ -115,3 +115,4 @@ activate:
|
||||
private-key: "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCcUyYhVqczGxblL+o/xZzF/8nf+LjrfUE/dS1aRHM7uMDD0cgCArhjtfneFePrMxt+Z7W8yNBzSarub8qsfhaVNikV7Es7oaeTygfjQXTi2n4AFkir3fM07J08RpWhl5M8f8uWTCuvFUYAw00gq55typqmnbkmJa2VIUy/iQf+cMCP7abz4/jNhUzUR3qA7TV4oMRgTdIEDUp63YF8dOC+JH8XxYrCVeHXV6fLCwmesdMzl0lB2VTEKMfLbXhOmF5g7P9y/16VCcN8UBuZlbyYfn+GAxJOSbeHi5HshOKfoSuD7Jz+3WQZpNavOWjIFExKIU38/CvnJCOP7XBCqpSTAgMBAAECggEAYeWokWRE3TpvwiOZnUpR/aVMdVi75a3ROL5XIpqPV61B+t/bU3cEpl0GF9C5pUeiRi0IoStZb3mI9D1KPW/REKyUWkhabQO1gFYbTnRlkNOn6MILzKX4cwJjDaZeeo4EBPU7N+qHyOOXrU6hdH5FfxhMdV983ajm5eeuupxER1C2kAcIklTeVpTX6EKOgZb5LBp5ssOVm2P42pOauvcRozRcvZmqnErXmukv0H4l3EVNt4rHpTn9riHUC63e8JfiYzVaF6zuNUxv6nHEft0/SRMw11XSTnNfDzcKqgjz6ksFBS/6eQQYKESk+ONC53HUuYHFAknkwsPupDCT2W8FIQKBgQDLHT/xCU3nxGr4vFKBDNaO2D5oK20ECbBO4oDvLWWmQG7f+6TsMy8PgVdMnoL4RfqGlwFAKEpS6KVFHnBVqnNEhcdy9uCI7x7Xx8UnyUtxj1EDTm76uta9Ki9OrlqB6tImDM9+Ya3vGktW37ht4WOx2OsJRhG1dbf6RLwFlH7DWwKBgQDFBxvi5I1BR6hg6Tj7xd2SqOT2Y+BED3xuSYENhWbmMhLJDResaB7mjztbxlYaY2mOE0holWm2uDmVFFhMh4jYXik4hYH8nmDzq9mDpZCZ9pyjYqnAP8THoAa8EbgrUWB8A6BPH4iL3KbMnBfBKY0pIr2xrvnjQjNBAgta7KDRKQKBgCe6oe4wxrdF2TKsC2tIqpMoQxS3Icy/ZGgZr+SYuaBKTCWtoDW/UT40K3JGMxIDBhzbXphBCUCsVt9tM8Xd4EwP6tJW7dZ7B0pnve2pVwNwaAVAiz6p2yUHIle+jN+Koe5lZRSwYIg7WW81tWpwwsJfzqFyvjYDP6hJV4mz4ROvAoGAaRcdnKvjXApomShMqJ4lTPChD3q+SA8qg3jZSOj6tZXHx00gb2kp8jg7pPvpOTIFPy6x1Ha9aCRjMk0ju84fA6lVuzwa1S907wOehUVuF3Eeo1cgy9Y3k3KbpPyeixxgpkUY4JslLdSHc2NemD0dee951qhJyRmqVOZOQDUuoeECgYEAqBw2cAFk3vM97WY06TSldGA8ajVHx3BYRjj+zl62NTQthy8fw3tqxb3c5e8toOmZWKjZvDhg2TRLhsDDQWEYg3LZG87REqVIjgEPcpjNLidjygGX8n3JF2o0O5I/EMvl0s/+LVQONfduOBvhwDqr8QNisbLsyneiAq7umewMolo="
|
||||
public-key: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnFMmIVanMxsW5S/qP8Wcxf/J3/i4631BP3UtWkRzO7jAw9HIAgK4Y7X53hXj6zMbfme1vMjQc0mq7m/KrH4WlTYpFexLO6Gnk8oH40F04tp+ABZIq93zNOydPEaVoZeTPH/LlkwrrxVGAMNNIKuebcqapp25JiWtlSFMv4kH/nDAj+2m8+P4zYVM1Ed6gO01eKDEYE3SBA1Ket2BfHTgviR/F8WKwlXh11enywsJnrHTM5dJQdlUxCjHy214TpheYOz/cv9elQnDfFAbmZW8mH5/hgMSTkm3h4uR7ITin6Erg+yc/t1kGaTWrzloyBRMSiFN/Pwr5yQjj+1wQqqUkwIDAQAB"
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
build/extraResources/mysql/data/#innodb_redo/#ib_redo35
Normal file
BIN
build/extraResources/mysql/data/#innodb_redo/#ib_redo35
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
34820
|
||||
74476
|
||||
|
||||
Binary file not shown.
BIN
build/extraResources/mysql/data/binlog.000031
Normal file
BIN
build/extraResources/mysql/data/binlog.000031
Normal file
Binary file not shown.
@@ -6,3 +6,4 @@
|
||||
.\binlog.000028
|
||||
.\binlog.000029
|
||||
.\binlog.000030
|
||||
.\binlog.000031
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
build/extraResources/mysql/data/pqs9100/pq_standard_dev_gain.ibd
Normal file
BIN
build/extraResources/mysql/data/pqs9100/pq_standard_dev_gain.ibd
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -19,9 +19,9 @@ VITE_API_URL=/api
|
||||
|
||||
# 开发环境跨域代理,支持配置多个
|
||||
|
||||
#VITE_PROXY=[["/api","http://127.0.0.1:18092/"]]
|
||||
VITE_PROXY=[["/api","http://127.0.0.1:18092/"]]
|
||||
#VITE_PROXY=[["/api","http://192.168.1.124:18092/"]]
|
||||
VITE_PROXY=[["/api","http://192.168.2.125:18092/"]]
|
||||
#VITE_PROXY=[["/api","http://192.168.2.125:18092/"]]
|
||||
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文
|
||||
# 开启激活验证
|
||||
VITE_ACTIVATE_OPEN=false
|
||||
@@ -23,6 +23,6 @@ VITE_PWA=true
|
||||
|
||||
# 线上环境接口地址
|
||||
#VITE_API_URL="/api" # 打包时用
|
||||
VITE_API_URL="http://127.0.0.1:18093/"
|
||||
VITE_API_URL="http://127.0.0.1:18092/"
|
||||
# 开启激活验证
|
||||
VITE_ACTIVATE_OPEN=true
|
||||
VITE_ACTIVATE_OPEN=false
|
||||
@@ -14,7 +14,8 @@ export const getScriptList = (params: {
|
||||
devId:string,
|
||||
chnNum:number,
|
||||
num:number,
|
||||
planId:string
|
||||
planId:string,
|
||||
code:string
|
||||
}) => {
|
||||
return http.post('/result/getCheckItem', params, {loading: false})
|
||||
}
|
||||
|
||||
@@ -35,9 +35,25 @@ export namespace StandardDevice {
|
||||
updateBy?: string | null; //更新用户
|
||||
updateTime?: string | null; //更新时间
|
||||
disabled?: boolean;
|
||||
gainList?:Gain[]
|
||||
}
|
||||
|
||||
|
||||
interface Gain{
|
||||
stdDevMonitorId:string;
|
||||
uaGain:number;
|
||||
ubGain:number;
|
||||
ucGain:number;
|
||||
u0Gain:number;
|
||||
iaGain:number;
|
||||
ibGain:number;
|
||||
icGain:number;
|
||||
i0Gain:number;
|
||||
uabGain:number;
|
||||
ubcGain:number;
|
||||
ucaGain:number;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准设备表格查询分页返回的对象;
|
||||
*/
|
||||
|
||||
@@ -14,6 +14,7 @@ export namespace Base {
|
||||
createTime?: string| null; //创建时间
|
||||
updateBy?: string| null; //更新用户
|
||||
updateTime?: string| null; //更新时间
|
||||
coefficient:number //比对监测后,当电压、电流不符合时,是否对标准设备进行系数校准
|
||||
|
||||
}
|
||||
}
|
||||
@@ -57,3 +57,14 @@ export const getPublicKey = (username: string) => {
|
||||
export const getAutoGenerate = () => {
|
||||
return http.get('/sysTestConfig/getAutoGenerate', {}, {loading: false})
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取比对模式下是否能够进行系数校准
|
||||
*/
|
||||
export const getCanCoefficient=()=>{
|
||||
return http.get('/prepare/canCoefficient', {}, {loading: false})
|
||||
}
|
||||
|
||||
export const startCoefficient=()=>{
|
||||
return http.get('/prepare/startCoefficient', {}, {loading: false})
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ export default class SocketService {
|
||||
* WebSocket连接配置
|
||||
*/
|
||||
private config: SocketConfig = {
|
||||
url: 'ws://127.0.0.1:7777/hello',
|
||||
url: 'ws://127.0.0.1:7778/hello',
|
||||
//url: 'ws://192.168.1.124:7777/hello',
|
||||
heartbeatInterval: 9000, // 9秒心跳间隔
|
||||
reconnectDelay: 5000, // 5秒重连延迟
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -128,7 +128,7 @@ import {CheckData} from '@/api/check/interface'
|
||||
import {useCheckStore} from '@/stores/modules/check'
|
||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||
import {getBigTestItem} from '@/api/check/test'
|
||||
import {getAutoGenerate} from '@/api/user/login'
|
||||
import {getAutoGenerate, getCanCoefficient, startCoefficient} from '@/api/user/login'
|
||||
import { generateDevReport } from '@/api/plan/plan'
|
||||
import {useModeStore} from '@/stores/modules/mode' // 引入模式 store
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
@@ -157,11 +157,6 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits([
|
||||
'update:testStatus',
|
||||
'update:webMsgSend',
|
||||
'sendPause',
|
||||
'sendResume',
|
||||
'sendReCheck',
|
||||
'closeWebSocket'
|
||||
])
|
||||
|
||||
// 用来保存测试项进度抽屉是否打开
|
||||
@@ -684,16 +679,37 @@ const updatePercentage = async () => {
|
||||
})
|
||||
}
|
||||
stopTimeCount(1)
|
||||
ElMessageBox.alert(
|
||||
'检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作',
|
||||
'检测完成',
|
||||
{
|
||||
confirmButtonText: '确定'
|
||||
}
|
||||
)
|
||||
// 关闭WebSocket连接
|
||||
emit('closeWebSocket')
|
||||
//clear();
|
||||
|
||||
let { data: canCoefficient } = await getCanCoefficient()
|
||||
if(canCoefficient) {
|
||||
ElMessageBox.confirm('存在系数偏差,是否进行系数校准?', '系数校准', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async ()=>{
|
||||
// 调用系数校准接口
|
||||
await startCoefficient()
|
||||
ElMessage.success({ message: '系数下发中,请稍等...', duration: 15000 ,onClose() {
|
||||
ElMessage.success('系数下发成功!')
|
||||
},})
|
||||
}).catch(()=>{
|
||||
ElMessageBox.alert(
|
||||
'检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作',
|
||||
'检测完成',
|
||||
{
|
||||
confirmButtonText: '确定'
|
||||
}
|
||||
)
|
||||
})
|
||||
}else{
|
||||
ElMessageBox.alert(
|
||||
'检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作',
|
||||
'检测完成',
|
||||
{
|
||||
confirmButtonText: '确定'
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
// ========== 时间计数器管理函数 ==========
|
||||
@@ -862,7 +878,6 @@ const handleClick = (item: any, chnNum: number, scriptType: string) => {
|
||||
}
|
||||
|
||||
const handlePause = () => {
|
||||
//emit('sendPause')
|
||||
testLogList.push({
|
||||
type: 'error',
|
||||
log: `${new Date().toLocaleString()}:当前测试小项正在执行中,将在该小项执行结束后暂停...`
|
||||
|
||||
@@ -198,8 +198,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="tsx" name="useProTable">
|
||||
import { onBeforeMount, onMounted, type PropType, reactive, ref, watch } from 'vue'
|
||||
import { type Action, ElMessage, ElMessageBox } from 'element-plus'
|
||||
import {onBeforeMount, onMounted, type PropType, reactive, ref, watch} from 'vue'
|
||||
import {type Action, ElMessage, ElMessageBox} from 'element-plus'
|
||||
import TestPopup from './testPopup.vue'
|
||||
import dataCheckPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||
import CompareDataCheckSingleChannelSingleTestPopup from '@/views/home/components/compareDataCheckSingleChannelSingleTestPopup.vue'
|
||||
@@ -207,20 +207,20 @@ import ProTable from '@/components/ProTable/index.vue'
|
||||
import SelectTestItemPopup from '@/views/home/components/selectTestItemPopup.vue'
|
||||
import WriteTHPopup from '@/views/home/components/writeTHPopup.vue'
|
||||
import DeviceConnectionPopup from '@/views/home/components/deviceConnectionPopup.vue'
|
||||
import { type Device } from '@/api/device/interface/device'
|
||||
import { type ColumnProps, type ProTableInstance } from '@/components/ProTable/interface'
|
||||
import { type Plan } from '@/api/plan/interface'
|
||||
import { type StandardDevice } from '@/api/device/interface/standardDevice'
|
||||
import { downloadDevData, generateDevReport, getBoundPqDevList } from '@/api/plan/plan'
|
||||
import { getPqDev } from '@/api/device/device'
|
||||
import { useAppSceneStore, useModeStore } from '@/stores/modules/mode' // 引入模式 store
|
||||
import { useCheckStore } from '@/stores/modules/check'
|
||||
import { CheckData } from '@/api/check/interface'
|
||||
import { useAuthStore } from '@/stores/modules/auth'
|
||||
import { useDownload } from '@/hooks/useDownload'
|
||||
import { documentedPqDev } from '@/api/device/report'
|
||||
import { ResultEnum } from '@/enums/httpEnum'
|
||||
import { getPqMonList } from '@/api/device/monitor/index'
|
||||
import {type Device} from '@/api/device/interface/device'
|
||||
import {type ColumnProps, type ProTableInstance} from '@/components/ProTable/interface'
|
||||
import {type Plan} from '@/api/plan/interface'
|
||||
import {type StandardDevice} from '@/api/device/interface/standardDevice'
|
||||
import {downloadDevData, generateDevReport, getBoundPqDevList} from '@/api/plan/plan'
|
||||
import {getPqDev} from '@/api/device/device'
|
||||
import {useAppSceneStore, useModeStore} from '@/stores/modules/mode' // 引入模式 store
|
||||
import {useCheckStore} from '@/stores/modules/check'
|
||||
import {CheckData} from '@/api/check/interface'
|
||||
import {useAuthStore} from '@/stores/modules/auth'
|
||||
import {useDownload} from '@/hooks/useDownload'
|
||||
import {documentedPqDev} from '@/api/device/report'
|
||||
import {ResultEnum} from '@/enums/httpEnum'
|
||||
import {getPqMonList} from '@/api/device/monitor/index'
|
||||
import ReportResultPopup from '@/views/home/components/reportResultPopup.vue'
|
||||
|
||||
const checkStore = useCheckStore()
|
||||
@@ -539,6 +539,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', minWidth :200,isShow: operationShow }
|
||||
])
|
||||
let testType = 'test' // 检测类型:'test'-检测 'reTest'-复检
|
||||
let qualifiedCount = 0 //合格数量
|
||||
|
||||
|
||||
//比对单个报告生成
|
||||
@@ -568,12 +569,14 @@ const handleSelectionChange = (selection: any[]) => {
|
||||
}
|
||||
|
||||
// 统计已完成检测的设备数量
|
||||
const result = selection.filter(item => item.checkResult != 0)
|
||||
let result = selection.filter(item => item.checkState == 0)
|
||||
if (result.length > 0) {
|
||||
testType = 'test'
|
||||
} else {
|
||||
testType = 'reTest'
|
||||
}
|
||||
qualifiedCount=selection.filter(item => item.checkResult == 1).length
|
||||
|
||||
let devices: CheckData.Device[] = selection.map((item: any) => {
|
||||
return {
|
||||
deviceId: item.id,
|
||||
@@ -925,6 +928,7 @@ const handleTest = async (val: string) => {
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: '不合格项复检',
|
||||
cancelButtonText: '全部复检',
|
||||
showConfirmButton:qualifiedCount<=0,
|
||||
type: 'warning'
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
@@ -1,100 +1,138 @@
|
||||
<template>
|
||||
<el-dialog :title="dialogTitle" v-model='dialogVisible' @close="close" v-bind="dialogBig" align-center>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="设备台账信息">
|
||||
<div >
|
||||
<el-form :model='formContent' ref='dialogFormRef' :rules='rules' :disabled="false" label-width="auto" class="form-three">
|
||||
<el-divider >设备信息</el-divider>
|
||||
|
||||
<el-form-item label="设备名称" prop="name" >
|
||||
<el-input v-model='formContent.name' placeholder="请输入设备名称" maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item label='设备类型' prop='devType' >
|
||||
<el-select v-model="formContent.devType" filterable clearable placeholder="请选择设备类型" @change="handleDevTypeChange">
|
||||
<el-option
|
||||
v-for="item in devTypeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='设备厂家' prop='manufacturer'>
|
||||
<el-select v-model="formContent.manufacturer" clearable placeholder="请选择设备厂家">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Manufacturers')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-divider >参数信息</el-divider>
|
||||
<el-form-item label='通讯协议' prop='protocol'>
|
||||
<el-select v-model="formContent.protocol" clearable placeholder="请选择通讯协议">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Protocol')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="IP地址" prop="ip" placeholder="请输入IP地址">
|
||||
<el-input v-model="formContent.ip"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="端口号" prop="port" placeholder="请输入端口号" >
|
||||
<el-input v-model="formContent.port" />
|
||||
</el-form-item>
|
||||
<el-form-item label='可检通道数' prop='inspectChannel' >
|
||||
<el-select v-model="formContent.inspectChannel" multiple collapse-tags :max-collapse-tags="4" placeholder="请选择可检通道数" clearable>
|
||||
<el-option
|
||||
v-for="(option, index) in pqChannelArray"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='是否加密' prop='encryptionFlag' >
|
||||
<el-select v-model="formContent.encryptionFlag" clearable placeholder="请选择是否加密">
|
||||
<el-option label="是" :value="1"></el-option>
|
||||
<el-option label="否" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='识别码' prop='series' clearable v-if="formContent.encryptionFlag">
|
||||
<el-input v-model='formContent.series' placeholder="请输入识别码" show-password/>
|
||||
</el-form-item>
|
||||
<el-form-item label='密钥' prop='devKey' clearable v-if="formContent.encryptionFlag">
|
||||
<el-input v-model='formContent.devKey' placeholder="请输入密钥" show-password/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-dialog :title="dialogTitle" v-model='dialogVisible' @close="close" v-bind="dialogBig" align-center>
|
||||
<el-tabs type="border-card" v-model="activeName">
|
||||
<el-tab-pane label="设备台账信息" name="devInfo">
|
||||
<div>
|
||||
<el-form :model='formContent' ref='dialogFormRef' :rules='rules' :disabled="false" label-width="auto" class="form-three">
|
||||
<el-divider>设备信息</el-divider>
|
||||
|
||||
<el-form-item label="设备名称" prop="name">
|
||||
<el-input v-model='formContent.name' placeholder="请输入设备名称" maxlength="32" show-word-limit/>
|
||||
</el-form-item>
|
||||
<el-form-item label='设备类型' prop='devType'>
|
||||
<el-select v-model="formContent.devType" filterable clearable placeholder="请选择设备类型" @change="handleDevTypeChange">
|
||||
<el-option
|
||||
v-for="item in devTypeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='设备厂家' prop='manufacturer'>
|
||||
<el-select v-model="formContent.manufacturer" clearable placeholder="请选择设备厂家">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Dev_Manufacturers')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-divider>参数信息</el-divider>
|
||||
<el-form-item label='通讯协议' prop='protocol'>
|
||||
<el-select v-model="formContent.protocol" clearable placeholder="请选择通讯协议">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Protocol')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="IP地址" prop="ip" placeholder="请输入IP地址">
|
||||
<el-input v-model="formContent.ip"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="端口号" prop="port" placeholder="请输入端口号">
|
||||
<el-input v-model="formContent.port"/>
|
||||
</el-form-item>
|
||||
<el-form-item label='可检通道数' prop='inspectChannel'>
|
||||
<el-select v-model="formContent.inspectChannel" multiple collapse-tags :max-collapse-tags="4" placeholder="请选择可检通道数" clearable>
|
||||
<el-option
|
||||
v-for="(option, index) in pqChannelArray"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='是否加密' prop='encryptionFlag'>
|
||||
<el-select v-model="formContent.encryptionFlag" clearable placeholder="请选择是否加密">
|
||||
<el-option label="是" :value="1"></el-option>
|
||||
<el-option label="否" :value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label='识别码' prop='series' clearable v-if="formContent.encryptionFlag">
|
||||
<el-input v-model='formContent.series' placeholder="请输入识别码" show-password/>
|
||||
</el-form-item>
|
||||
<el-form-item label='密钥' prop='devKey' clearable v-if="formContent.encryptionFlag">
|
||||
<el-input v-model='formContent.devKey' placeholder="请输入密钥" show-password/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="通道系数" name="gainInfo">
|
||||
<el-tabs type="border-card" style="margin: 15px 0px;">
|
||||
<el-tab-pane v-for="(item, index) in formContent.gainList" :label="'通道'+(index+1)">
|
||||
<el-form :model='item' ref='gainFormRef' :disabled="true" class="form-four">
|
||||
<el-form-item label-width="30" label-position="left" label="ua" prop="uaGain">
|
||||
<el-input v-model="item.uaGain"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="30" label-position="left" label="ub" prop="ubGain">
|
||||
<el-input v-model="item.ubGain"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="30" label-position="left" label="uc" prop="ucGain">
|
||||
<el-input v-model="item.ucGain"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="30" label-position="left" label="u0" prop="u0Gain">
|
||||
<el-input v-model="item.u0Gain"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="30" label-position="left" label="ia" prop="iaGain">
|
||||
<el-input v-model="item.iaGain"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="30" label-position="left" label="ib" prop="ibGain">
|
||||
<el-input v-model="item.ibGain"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="30" label-position="left" label="ic" prop="icGain">
|
||||
<el-input v-model="item.icGain"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="30" label-position="left" label="i0" prop="i0Gain">
|
||||
<el-input v-model="item.i0Gain"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="30" label-position="left" label="uab" prop="uabGain">
|
||||
<el-input v-model="item.uabGain"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="30" label-position="left" label="ubc" prop="uabGain">
|
||||
<el-input v-model="item.ubcGain"/>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="30" label-position="left" label="uca" prop="ucaGain">
|
||||
<el-input v-model="item.ucaGain"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<div >
|
||||
<el-button @click='close()'>取 消</el-button>
|
||||
<el-button type="primary" @click='save()'>保存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<div>
|
||||
<el-button @click='close()'>取 消</el-button>
|
||||
<el-button type="primary" @click='save()'>保存</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
|
||||
import IPAddress from '@/components/IpAddress/index.vue'
|
||||
import { dialogBig } from '@/utils/elementBind'
|
||||
import {dialogBig} from '@/utils/elementBind'
|
||||
import {type StandardDevice} from '@/api/device/interface/standardDevice.ts'
|
||||
import { ElMessage, type FormItemRule } from 'element-plus'
|
||||
import { addPqStandardDev, updatePqStandardDev} from '@/api/device/standardDevice/index.ts'
|
||||
import { computed, reactive, type Ref, ref } from 'vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { CirclePlus, Delete, EditPen } from '@element-plus/icons-vue'
|
||||
import {ElMessage, type FormItemRule} from 'element-plus'
|
||||
import {addPqStandardDev, updatePqStandardDev} from '@/api/device/standardDevice/index.ts'
|
||||
import {computed, reactive, type Ref, ref} from 'vue'
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
import {type Device} from '@/api/device/interface/device.ts'
|
||||
// 使用 dayjs 库格式化
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
// 存储设备类型选项
|
||||
const devTypeOptions = ref<Device.ResDev[]>([])
|
||||
@@ -120,112 +158,114 @@ const pqChannelArray = ref([
|
||||
label: '4',
|
||||
},
|
||||
])
|
||||
const activeName=ref('devInfo')
|
||||
|
||||
function useMetaInfo() {
|
||||
const dialogVisible = ref(false)
|
||||
const titleType = ref('add')
|
||||
const formContent = reactive<StandardDevice.ResPqStandardDevice>({
|
||||
id: '',
|
||||
name: '',
|
||||
devType:'',
|
||||
manufacturer:'',
|
||||
protocol: 'MMS',
|
||||
ip: '',
|
||||
port: 102,
|
||||
inspectChannel:'',
|
||||
encryptionFlag: 0,
|
||||
state: 1,
|
||||
})
|
||||
return { dialogVisible, titleType, formContent }
|
||||
}
|
||||
|
||||
const { dialogVisible, titleType, formContent } = useMetaInfo()
|
||||
// 清空formContent
|
||||
const resetFormContent = () => {
|
||||
Object.assign(
|
||||
formContent,{
|
||||
|
||||
function useMetaInfo() {
|
||||
const dialogVisible = ref(false)
|
||||
const titleType = ref('add')
|
||||
const formContent = reactive<StandardDevice.ResPqStandardDevice>({
|
||||
id: '',
|
||||
name: '',
|
||||
devType: '',
|
||||
manufacturer: '',
|
||||
protocol: 'MMS',
|
||||
ip: '',
|
||||
port: 102,
|
||||
inspectChannel: '',
|
||||
encryptionFlag: 0,
|
||||
state: 1,
|
||||
})
|
||||
return {dialogVisible, titleType, formContent}
|
||||
}
|
||||
|
||||
const {dialogVisible, titleType, formContent} = useMetaInfo()
|
||||
// 清空formContent
|
||||
const resetFormContent = () => {
|
||||
Object.assign(
|
||||
formContent, {
|
||||
id: '',
|
||||
name: '',
|
||||
devType:'',
|
||||
manufacturer:'',
|
||||
devType: '',
|
||||
manufacturer: '',
|
||||
protocol: 'MMS',
|
||||
ip: '',
|
||||
port: 102,
|
||||
inspectChannel:'',
|
||||
inspectChannel: '',
|
||||
encryptionFlag: 0,
|
||||
state: 1,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
let dialogTitle = computed(() => {
|
||||
return titleType.value === 'add' ? '新增标准设备' : '编辑标准设备'
|
||||
})
|
||||
|
||||
|
||||
//定义校验规则
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name: [{required: true, message: '设备名称必填!', trigger: 'blur'}],
|
||||
devType: [{required: true, message: '设备类型必选!', trigger: 'change'}],
|
||||
manufacturer: [{required: true, message: '生产厂家必选!', trigger: 'change'}],
|
||||
ip: [
|
||||
{required: true, message: 'IP地址必填!', trigger: 'blur'},
|
||||
{pattern: /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, message: 'IP地址格式错误', trigger: 'blur'}
|
||||
],
|
||||
port: [
|
||||
{required: true, message: '端口号必填!', trigger: 'blur'},
|
||||
{pattern: /^(6553[0-5]|655[0-2][0-9]|64[0-9]{3}|[1-5]?[0-9]{1,4})$/, message: '端口号范围0到65535的整数', trigger: 'blur'}
|
||||
],
|
||||
inspectChannel: [{required: true, message: '可检通道数必选', trigger: 'change'}],
|
||||
encryptionFlag: [{required: true, message: '是否加密必选!', trigger: 'change'}],
|
||||
series: [{required: true, message: '请输入识别码', trigger: 'blur'}],
|
||||
devKey: [{required: true, message: '请输入密钥', trigger: 'blur'}],
|
||||
protocol: [{required: true, message: '通讯协议必选!', trigger: 'change'}],
|
||||
})
|
||||
|
||||
// 关闭弹窗
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
// 清空dialogForm中的值
|
||||
resetFormContent()
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
const save = () => {
|
||||
try {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (formContent.encryptionFlag === 0) {
|
||||
formContent.series = ''
|
||||
formContent.devKey = ''
|
||||
}
|
||||
if (valid) {
|
||||
//保存时判是否加密,把识别码密钥字段清空
|
||||
if (formContent.encryptionFlag === 0) {
|
||||
formContent.series = null
|
||||
formContent.devKey = null
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
let dialogTitle = computed(() => {
|
||||
return titleType.value === 'add' ? '新增标准设备' : '编辑标准设备'
|
||||
})
|
||||
|
||||
|
||||
//定义校验规则
|
||||
const rules: Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name : [{ required: true, message: '设备名称必填!', trigger: 'blur' }],
|
||||
devType: [{ required: true, message: '设备类型必选!', trigger: 'change' }],
|
||||
manufacturer:[{ required: true, message: '生产厂家必选!', trigger: 'change' }],
|
||||
ip: [
|
||||
{ required: true, message: 'IP地址必填!', trigger: 'blur' },
|
||||
{ pattern: /^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, message: 'IP地址格式错误', trigger: 'blur' }
|
||||
],
|
||||
port: [
|
||||
{ required: true, message: '端口号必填!', trigger: 'blur' },
|
||||
{ pattern: /^(6553[0-5]|655[0-2][0-9]|64[0-9]{3}|[1-5]?[0-9]{1,4})$/, message: '端口号范围0到65535的整数', trigger: 'blur' }
|
||||
],
|
||||
inspectChannel:[ { required: true, message: '可检通道数必选', trigger: 'change' }],
|
||||
encryptionFlag: [{ required: true, message: '是否加密必选!', trigger: 'change' }],
|
||||
series: [{ required: true, message: '请输入识别码', trigger: 'blur' }],
|
||||
devKey: [{ required: true, message: '请输入密钥', trigger: 'blur' }],
|
||||
protocol: [{required: true, message: '通讯协议必选!', trigger: 'change'}],
|
||||
})
|
||||
|
||||
// 关闭弹窗
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
// 清空dialogForm中的值
|
||||
resetFormContent()
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
const save = () => {
|
||||
try {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (formContent.encryptionFlag === 0) {
|
||||
formContent.series = ''
|
||||
formContent.devKey = ''
|
||||
}
|
||||
if (valid) {
|
||||
//保存时判是否加密,把识别码密钥字段清空
|
||||
if(formContent.encryptionFlag === 0){
|
||||
formContent.series = null
|
||||
formContent.devKey = null
|
||||
}
|
||||
|
||||
// 可检通道转为字符串逗号分隔(保存前临时转换)
|
||||
let originalInspectChannel = formContent.inspectChannel; // 保存原始值
|
||||
//可检通道转为字符串逗号分隔
|
||||
// 确保 inspectChannel 是数组再执行 join
|
||||
if (Array.isArray(formContent.inspectChannel)) {
|
||||
formContent.inspectChannel = formContent.inspectChannel
|
||||
//可检通道转为字符串逗号分隔
|
||||
// 确保 inspectChannel 是数组再执行 join
|
||||
if (Array.isArray(formContent.inspectChannel)) {
|
||||
formContent.inspectChannel = formContent.inspectChannel
|
||||
.map(Number) // 将值转为数字以保证正确排序
|
||||
.sort((a, b) => a - b) // 数字升序排序
|
||||
.map(String) // 恢复为字符串用于保存
|
||||
.join(',');
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
if (formContent.id) {
|
||||
await updatePqStandardDev(formContent);
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
} else {
|
||||
ElMessage.success({message: `${dialogTitle.value}成功!`})
|
||||
} else {
|
||||
// 新增需要把通讯协议转成字典ID
|
||||
const protocolItem = dictStore.getDictData('Protocol').find(item => item.name === formContent.protocol);
|
||||
if (protocolItem) {
|
||||
@@ -233,7 +273,7 @@ const pqChannelArray = ref([
|
||||
}
|
||||
|
||||
await addPqStandardDev(formContent);
|
||||
ElMessage.success({ message: `${dialogTitle.value}成功!` })
|
||||
ElMessage.success({message: `${dialogTitle.value}成功!`})
|
||||
}
|
||||
close()
|
||||
// 刷新表格
|
||||
@@ -249,7 +289,7 @@ const pqChannelArray = ref([
|
||||
formContent.inspectChannel = formContent.inspectChannel.split(',').filter(Boolean);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('验证过程中出现错误', err)
|
||||
@@ -258,20 +298,22 @@ const pqChannelArray = ref([
|
||||
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = async (sign: string, data: StandardDevice.ResPqStandardDevice,devType:Device.ResDev[]) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
devTypeOptions.value = devType
|
||||
titleType.value = sign
|
||||
if (data.id) {
|
||||
Object.assign(formContent,{ ...data })
|
||||
if (typeof formContent.inspectChannel === 'string') {
|
||||
formContent.inspectChannel = formContent.inspectChannel.split(',').filter(Boolean)
|
||||
}
|
||||
//handleDevTypeChange(data.devType)
|
||||
} else {
|
||||
resetFormContent()
|
||||
const open = async (sign: string, data: StandardDevice.ResPqStandardDevice, devType: Device.ResDev[]) => {
|
||||
activeName.value = 'devInfo'
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
devTypeOptions.value = devType
|
||||
titleType.value = sign
|
||||
if (data.id) {
|
||||
Object.assign(formContent, {...data})
|
||||
console.log(formContent)
|
||||
if (typeof formContent.inspectChannel === 'string') {
|
||||
formContent.inspectChannel = formContent.inspectChannel.split(',').filter(Boolean)
|
||||
}
|
||||
//handleDevTypeChange(data.devType)
|
||||
} else {
|
||||
resetFormContent()
|
||||
}
|
||||
|
||||
|
||||
dialogVisible.value = true
|
||||
@@ -281,38 +323,38 @@ const open = async (sign: string, data: StandardDevice.ResPqStandardDevice,devTy
|
||||
const handleDevTypeChange = (value: string) => {
|
||||
|
||||
// 在这里处理选中事件的逻辑
|
||||
const dev = devTypeOptions.value.find(t =>t.id === value)
|
||||
const dev = devTypeOptions.value.find(t => t.id === value)
|
||||
if (dev) {
|
||||
const maxChannel = dev.devChns
|
||||
const maxChannel = dev.devChns
|
||||
// 动态设置 pqChannelArray 从 1 到 dev.devChns.length
|
||||
pqChannelArray.value = Array.from({ length: dev.devChns }, (_, i) => ({
|
||||
pqChannelArray.value = Array.from({length: dev.devChns}, (_, i) => ({
|
||||
value: String(i + 1),
|
||||
label: String(i + 1),
|
||||
}))
|
||||
|
||||
//if(titleType.value == 'add') // 默认全选所有通道
|
||||
formContent.inspectChannel = pqChannelArray.value.map(channel => channel.value)
|
||||
formContent.inspectChannel = pqChannelArray.value.map(channel => channel.value)
|
||||
// 过滤掉超出新通道数范围的选项
|
||||
if (Array.isArray(formContent.inspectChannel)) {
|
||||
formContent.inspectChannel = formContent.inspectChannel.filter(
|
||||
(channel) => parseInt(channel, 10) <= maxChannel
|
||||
(channel) => parseInt(channel, 10) <= maxChannel
|
||||
)
|
||||
}
|
||||
} else {
|
||||
// 可选:恢复默认值
|
||||
pqChannelArray.value = [
|
||||
{ value: '1', label: '1' },
|
||||
{ value: '2', label: '2' },
|
||||
{ value: '3', label: '3' },
|
||||
{ value: '4', label: '4' },
|
||||
{value: '1', label: '1'},
|
||||
{value: '2', label: '2'},
|
||||
{value: '3', label: '3'},
|
||||
{value: '4', label: '4'},
|
||||
]
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 对外映射
|
||||
defineExpose({ open })
|
||||
defineExpose({open})
|
||||
const props = defineProps<{
|
||||
refreshTable: (() => Promise<void>) | undefined;
|
||||
}>()
|
||||
|
||||
@@ -99,13 +99,11 @@ const handleInputRetainTime = value => {
|
||||
ElMessage.warning("持续时间不能小于0周波")
|
||||
props.childForm[0].dipData.retainTime = 0
|
||||
emit('setRetainTime', 0 )
|
||||
}else if (value > 300) {
|
||||
ElMessage.warning("持续时间不能大于300周波")
|
||||
props.childForm[0].dipData.retainTime = 300
|
||||
emit('setRetainTime', 300 )
|
||||
}else if (value > 3000) {
|
||||
ElMessage.warning("持续时间不能大于3000周波")
|
||||
props.childForm[0].dipData.retainTime = 3000
|
||||
emit('setRetainTime', 3000 )
|
||||
}else{
|
||||
|
||||
|
||||
emit('setRetainTime', value )
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@
|
||||
v-model="formContent.testConfig!.realTime"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
:min="40"
|
||||
:min="20"
|
||||
placeholder="请输入实时数据有效组数"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
<el-input number v-model.number='TestConfigForm.scale' placeholder="请输入误差保留小数位" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="modeStore.currentMode=='比对式'">
|
||||
<el-form-item label='是否进行系数校准' prop='coefficient' :label-width="140">
|
||||
<el-switch v-model="TestConfigForm.coefficient" :active-value="1" :inactive-value="0" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">-->
|
||||
<!-- <el-form-item label='数据处理原则' prop='dataRule' :label-width="140">-->
|
||||
<!-- <el-select v-model="TestConfigForm.dataRule" clearable placeholder="请选择数据处理原则">-->
|
||||
@@ -235,6 +240,7 @@ const TestConfigForm = ref<Base.ResTestConfig>({
|
||||
maxTime: 3,
|
||||
state: 1, //状态
|
||||
scale:4,
|
||||
coefficient:0,
|
||||
})
|
||||
|
||||
const RegResForm = ref<VersionRegister.ResSys_Reg_Res>({
|
||||
|
||||
Reference in New Issue
Block a user