Compare commits
13 Commits
NPQS9100V1
...
qr_branch
| Author | SHA1 | Date | |
|---|---|---|---|
| 466d552165 | |||
| 9d23303919 | |||
| 83cdc4ba30 | |||
|
|
29efbae717 | ||
|
|
a5177860de | ||
|
|
66019e0d3c | ||
|
|
0ca992134f | ||
|
|
128b02c145 | ||
|
|
bbc08679b9 | ||
|
|
bf8b8c9f0f | ||
|
|
00893d2d1f | ||
| 327801d040 | |||
|
|
9e8e44b886 |
@@ -43,4 +43,9 @@ export const getPqReportAllVersion = (params:any) => {
|
||||
//被检设备归档
|
||||
export const documentedPqDev = (ids: string[]) => {
|
||||
return http.post(`/report/documented`, ids)
|
||||
}
|
||||
|
||||
//上传报告到云端
|
||||
export const uploadReportToCloud = (deviceIds: string[]) => {
|
||||
return http.post(`/report/uploadReportToCloud`, deviceIds)
|
||||
}
|
||||
@@ -57,9 +57,9 @@ export default class SocketService {
|
||||
this.connected = false;
|
||||
this.connectRetryCount++;
|
||||
this.clearHeartbeat();
|
||||
/* setTimeout(() => {
|
||||
this.connect();
|
||||
}, 500 * this.connectRetryCount);*/
|
||||
/* setTimeout(() => {
|
||||
this.connect();
|
||||
}, 500 * this.connectRetryCount);*/
|
||||
|
||||
|
||||
};
|
||||
@@ -121,7 +121,7 @@ export default class SocketService {
|
||||
return;
|
||||
}
|
||||
_this.sendHeartbeat();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
sendHeartbeat() {
|
||||
|
||||
@@ -262,6 +262,12 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else if (newValue.code == -1) { //todo 10552之后还会发送消息吗?
|
||||
ElMessageBox.alert('源未知异常', '检测失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
TableInit();
|
||||
} else {
|
||||
console.log('显示东西code', newValue.code)
|
||||
console.log('显示东西requestId', newValue.requestId)
|
||||
|
||||
@@ -501,6 +501,14 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
})
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
}else if (newValue.code == -1) {
|
||||
step4.value = 'error'
|
||||
step4InitLog.value = [{
|
||||
type: 'error',
|
||||
log: '源未知异常!',
|
||||
}];
|
||||
ts.value = 'error'
|
||||
step5.value = 'error'
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
link
|
||||
:icon='Download'
|
||||
@click="openDrawer('报告下载', scope.row)"
|
||||
v-if='form.activeTabs === 3 && form.activeChildTabs === 0 && scope.row.reportState === 1'
|
||||
v-if='form.activeTabs === 3 && form.activeChildTabs === 0 && (scope.row.reportState === 1 ||scope.row.reportState === 3)'
|
||||
>报告下载
|
||||
</el-button>
|
||||
|
||||
@@ -582,6 +582,8 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
return '已生成'
|
||||
} else if (scope.row.reportState === 2) {
|
||||
return '未检'
|
||||
}else if(scope.row.reportState === 3){
|
||||
return '已上传'
|
||||
}
|
||||
return ''
|
||||
},
|
||||
@@ -1052,6 +1054,7 @@ const handleTest = async (val: string) => {
|
||||
})
|
||||
checkStore.setSelectTestItems({preTest: false, timeTest: false, channelsTest: false, test: true})
|
||||
} else {
|
||||
checkStore.setReCheckType(1)
|
||||
openTestDialog(true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,6 +390,16 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
})
|
||||
// emit('update:testStatus', 'recheck')
|
||||
emit('update:testStatus', 'test_init_fail')
|
||||
} else if (newValue.code == -1) {
|
||||
ElMessageBox.alert('源未知异常!', '检测失败!', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
testLogList.push({
|
||||
type: 'error',
|
||||
log: `${new Date().toLocaleString()}:源未知异常!`
|
||||
})
|
||||
emit('update:testStatus', 'error')
|
||||
} else {
|
||||
switch (newValue.requestId) {
|
||||
case 'server_error':
|
||||
@@ -470,14 +480,14 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:源初始化成功!`})
|
||||
percentage.value = 1
|
||||
}
|
||||
if (newValue.code == -1) {
|
||||
ElMessageBox.alert('源未知异常!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源未知异常!`})
|
||||
emit('update:testStatus', 'test_init_fail')
|
||||
}
|
||||
// if (newValue.code == -1) {
|
||||
// ElMessageBox.alert('源未知异常!', '初始化失败', {
|
||||
// confirmButtonText: '确定',
|
||||
// type: 'error',
|
||||
// })
|
||||
// testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源未知异常!`})
|
||||
// emit('update:testStatus', 'test_init_fail')
|
||||
// }
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -730,7 +740,7 @@ const initScriptData = async () => {
|
||||
|
||||
let response: any = await getBigTestItem({reCheckType: checkStore.reCheckType, planId: checkStore.plan.id, devIds: checkStore.devices.map(item => item.deviceId)})
|
||||
|
||||
let temp = response.data.map(item => {
|
||||
let temp = response.data.map((item: any) => {
|
||||
return {
|
||||
...item,
|
||||
scriptName: item.scriptName
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<el-dialog :title="dialogTitle" width="1550px" :model-value="dialogVisible" :before-close="beforeClose" @close="handleClose" height="1000px" draggable>
|
||||
|
||||
<div class="steps-container">
|
||||
<el-steps class="test-head-steps" simple :active="stepsActiveIndex" process-status="finish" finish-status="success">
|
||||
<el-steps v-if="showSteps" class="test-head-steps" simple :active="stepsActiveIndex" process-status="finish" finish-status="success">
|
||||
<el-step v-if="preTestSelected" title="预检测" :icon="stepsActive > 1 || stepsActiveIndex > stepsTotalNum-1? SuccessFilled :Edit" @click="handleStepClick(1)"/>
|
||||
<el-step v-if="timeTestSelected" title="守时检测" :icon="stepsActive > 2 || stepsActiveIndex > stepsTotalNum-1? SuccessFilled :UploadFilled"
|
||||
@click="handleStepClick(2)"/>
|
||||
@@ -86,6 +86,7 @@ const checkStore = useCheckStore();
|
||||
const nextStepText = ref('下一步');
|
||||
const dialogVisible = ref(false)
|
||||
|
||||
const showSteps = ref(false)
|
||||
const stepsTotalNum = ref(-1);//步骤总数
|
||||
const stepsActiveIndex = ref(1); //当前正在执行的步骤索引
|
||||
const stepsActiveView = ref(-1); //当前正在执行的步骤在(预处理、守时校验、系数校准、正式检测)中的排序,仅用于页面显示
|
||||
@@ -159,6 +160,7 @@ const initOperate = () => {
|
||||
}
|
||||
|
||||
const open = (title: string) => {
|
||||
showSteps.value = true
|
||||
initOperate()
|
||||
dialogTitle.value = title;
|
||||
dialogVisible.value = true;
|
||||
@@ -488,6 +490,7 @@ const beforeClose = (done: () => void) => {
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
showSteps.value = false
|
||||
dataSocket.socketServe.closeWs()
|
||||
dialogVisible.value = false;
|
||||
clearData()
|
||||
|
||||
@@ -159,14 +159,12 @@
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
|
||||
import IPAddress from '@/components/IpAddress/index.vue'
|
||||
import {dialogBig} from '@/utils/elementBind'
|
||||
import {type Device} from '@/api/device/interface/device'
|
||||
import {ElMessage, type FormItemRule} from 'element-plus'
|
||||
import {addPqDev, updatePqDev} from '@/api/device/device'
|
||||
import {computed, reactive, type Ref, ref} from 'vue'
|
||||
import {computed, ref} from 'vue'
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
import {CirclePlus, Delete, EditPen} from '@element-plus/icons-vue'
|
||||
// 使用 dayjs 库格式化
|
||||
import dayjs from 'dayjs'
|
||||
import MonitorTable from '@/views/machine/device/components/monitorTab.vue';
|
||||
@@ -204,7 +202,7 @@ function useMetaInfo() {
|
||||
hardwareVersion: '',
|
||||
softwareVersion: '',
|
||||
protocol: 'MMS',
|
||||
ip: '',
|
||||
ip: '172.17.102.222',
|
||||
port: 102,
|
||||
encryptionFlag: 0,
|
||||
reCheckNum: 0,
|
||||
@@ -213,7 +211,7 @@ function useMetaInfo() {
|
||||
icdId: '',
|
||||
power: '',
|
||||
preinvestmentPlan: '',
|
||||
delegate:''
|
||||
delegate: ''
|
||||
})
|
||||
return {dialogVisible, titleType, formContent}
|
||||
}
|
||||
@@ -235,7 +233,7 @@ const resetFormContent = () => {
|
||||
hardwareVersion: '',
|
||||
softwareVersion: '',
|
||||
protocol: 'MMS',
|
||||
ip: '',
|
||||
ip: '172.17.102.222',
|
||||
port: 102,
|
||||
encryptionFlag: 0,
|
||||
reCheckNum: 0,
|
||||
@@ -244,7 +242,7 @@ const resetFormContent = () => {
|
||||
icdId: '',
|
||||
power: '',
|
||||
preinvestmentPlan: '',
|
||||
delegate:''
|
||||
delegate: ''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,15 +444,17 @@ const handleDevTypeChange = (value: string) => {
|
||||
formContent.value.devVolt = dev.devVolt; // 默认值为1
|
||||
formContent.value.icdId = dev.icd
|
||||
formContent.value.power = dev.power
|
||||
// if (dev.name.includes('882B')) {
|
||||
// formContent.value.ip = '172.17.102.220'
|
||||
// } else if (dev.name.includes('882A')) {
|
||||
// formContent.value.ip = '172.17.102.221'
|
||||
// } else {
|
||||
// formContent.value.ip = '172.17.102.200'
|
||||
// }
|
||||
|
||||
|
||||
if(scene.value === '1'){
|
||||
if (dev.name.includes('NPQS-581') || dev.name.includes('NPQS-580') || dev.name.includes('PQ-COM')) {
|
||||
formContent.value.encryptionFlag = 1
|
||||
formContent.value.series = 'Pqs&cn870299'
|
||||
formContent.value.devKey = '!qaz@wsx3edc4rfv'
|
||||
} else {
|
||||
formContent.value.encryptionFlag = 0
|
||||
formContent.value.series = null
|
||||
formContent.value.devKey = null
|
||||
}
|
||||
}
|
||||
} else {
|
||||
formContent.value.devChns = 1; // 默认值为1
|
||||
formContent.value.devCurr = 1; // 默认值为1
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<el-button v-auth.device="'import'" type='primary' :icon='Download' plain @click="importFile('比对式')"
|
||||
v-if='modeStore.currentMode === "比对式"'>导入
|
||||
</el-button>
|
||||
<el-button type='primary' :icon='Upload' plain @click='uploadFile()' v-if='appSceneStore.currentScene === "1"'>报告上传</el-button>
|
||||
<el-button v-auth.device="'delete'" type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
删除
|
||||
@@ -28,6 +29,8 @@
|
||||
</el-button>
|
||||
<el-button v-auth.device="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除
|
||||
</el-button>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
</ProTable>
|
||||
@@ -38,7 +41,7 @@
|
||||
|
||||
<script setup lang='tsx' name='useRole'>
|
||||
import TimeControl from '@/components/TimeControl/index.vue'
|
||||
import {type Device} from '@/api/device/interface/device.ts'
|
||||
import {type Device} from '@/api/device/interface/device'
|
||||
import {useHandleData} from '@/hooks/useHandleData'
|
||||
import {useDownload} from '@/hooks/useDownload'
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
@@ -47,8 +50,9 @@ import {type ColumnProps, type ProTableInstance} from '@/components/ProTable/int
|
||||
import DevicePopup from '@/views/machine/device/components/devicePopup.vue'
|
||||
import {CirclePlus, Delete, Download, EditPen, Upload} from '@element-plus/icons-vue'
|
||||
import {useDictStore} from '@/stores/modules/dict'
|
||||
import {deletePqDev, downloadTemplate, exportPqDev, getPqDev, getPqDevList, importPqDev} from '@/api/device/device/index.ts'
|
||||
import {ElMessageBox} from 'element-plus'
|
||||
import {deletePqDev, downloadTemplate, exportPqDev, getPqDev, getPqDevList, importPqDev} from '@/api/device/device/index'
|
||||
import {uploadReportToCloud} from '@/api/device/report/index'
|
||||
import {ElMessage, ElMessageBox} from 'element-plus'
|
||||
import {onBeforeMount, reactive, ref} from 'vue'
|
||||
import {useAppSceneStore, useModeStore} from '@/stores/modules/mode'
|
||||
|
||||
@@ -263,6 +267,40 @@ const importFile = async (pattern: string) => {
|
||||
|
||||
}
|
||||
|
||||
// 报告上传
|
||||
const uploadFile = async () => {
|
||||
const selectedRows = proTable.value?.selectedList || []
|
||||
|
||||
if (selectedRows.length === 0) {
|
||||
// 没有选择设备,弹出确认框询问是否处理全部
|
||||
ElMessageBox.confirm('未选择被检设备,是否对全部设备进行报告上传?', '提示', {
|
||||
type: 'warning',
|
||||
confirmButtonText: '全部上传',
|
||||
cancelButtonText: '取消'
|
||||
}).then(() => {
|
||||
// 用户确认全部上传,传递空数组或特殊标识
|
||||
handleReportUpload([])
|
||||
}).catch(() => {
|
||||
// 用户取消
|
||||
})
|
||||
} else {
|
||||
// 有选择设备,使用选中的设备ID
|
||||
const selectedIds = selectedRows.map(row => row.id)
|
||||
handleReportUpload(selectedIds)
|
||||
}
|
||||
}
|
||||
|
||||
// 处理报告上传
|
||||
const handleReportUpload = async (deviceIds: string[]) => {
|
||||
try {
|
||||
await uploadReportToCloud(deviceIds)
|
||||
ElMessage.success('报告上传成功')
|
||||
} catch (error) {
|
||||
ElMessage.error('报告上传失败')
|
||||
console.error('报告上传错误:', error)
|
||||
}
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
const response = await getPqDev()
|
||||
devTypeOptions.value = (response.data as Device.ResDev[]).map(item => ({
|
||||
|
||||
@@ -204,7 +204,11 @@ const waveList = [
|
||||
{
|
||||
fchagFre: '2400',
|
||||
fchagValue: '0.77'
|
||||
}
|
||||
},
|
||||
{
|
||||
fchagFre: '4000',
|
||||
fchagValue: '2.4'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user