Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1,26 +1,38 @@
|
||||
import type { ReqPage } from '@/api/interface'
|
||||
import type { ReqPage, ResPage } from '@/api/interface'
|
||||
|
||||
// 检测脚本模块
|
||||
export namespace TestScript {
|
||||
|
||||
|
||||
/**
|
||||
* 电能质量指标字典数据表格分页查询参数
|
||||
*/
|
||||
export interface ReqTestScriptParams extends ReqPage{
|
||||
id: string; // 装置序号id 必填
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
// 检测脚本接口
|
||||
export interface TestScriptBO {
|
||||
export interface ResTestScript {
|
||||
id?: string; //检测脚本ID
|
||||
name: string; //检测脚本名称
|
||||
type: string; //检测脚本类型(字典表Code字段,脚本还是模板)
|
||||
pattern: string;//检测脚本模式(字典表Code字段,数字、模拟、比对)
|
||||
valueType: string;//脚本值类型(字典表Code字段,相对值脚本、绝对值脚本、无)
|
||||
valueType?: string;//脚本值类型(字典表Code字段,相对值脚本、绝对值脚本、无)
|
||||
standardName: string;//参照标准名称
|
||||
standardTime: string;//标准推行时间
|
||||
state:number;//
|
||||
createBy: string;
|
||||
createTime: string;
|
||||
updateBy: string;
|
||||
updateTime: string;
|
||||
createBy?: string;
|
||||
createTime?: string;
|
||||
updateBy?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
// 检测脚本+分页
|
||||
export interface ReqTestScriptParams extends ReqPage,TestScriptBO {
|
||||
/**
|
||||
* 被检设备表格查询分页返回的对象;
|
||||
*/
|
||||
export interface ResPqDevPage extends ResPage<ResTestScript> {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,25 +2,25 @@ import type { Monitor } from '@/api/device/interface/monitor'
|
||||
import http from '@/api'
|
||||
|
||||
/**
|
||||
* @name 被检设备管理模块
|
||||
* @name 监测点管理模块
|
||||
*/
|
||||
|
||||
//获取被检设备
|
||||
//获取监测点
|
||||
export const getPqMonList = (params: Monitor.ReqPqMonParams) => {
|
||||
return http.post(`/pqMon/list`, params)
|
||||
}
|
||||
|
||||
//添加被检设备
|
||||
//添加监测点
|
||||
export const addPqMon = (params: Monitor.ResPqMon) => {
|
||||
return http.post(`/pqMon/add`, params)
|
||||
}
|
||||
|
||||
//编辑被检设备
|
||||
//编辑监测点
|
||||
export const updatePqMon = (params: Monitor.ResPqMon) => {
|
||||
return http.post(`/pqMon/update`, params)
|
||||
}
|
||||
|
||||
//删除被检设备
|
||||
//删除监测点
|
||||
export const deletePqMon = (params: string[]) => {
|
||||
return http.post(`/pqMon/delete`, params)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { ResPage } from '@/api/interface'
|
||||
import type { TestScript } from '@/api/device/interface/testScript'
|
||||
import http from '@/api'
|
||||
|
||||
@@ -6,7 +5,17 @@ import http from '@/api'
|
||||
* @name 检测脚本管理模块
|
||||
*/
|
||||
// 获取检测脚本列表
|
||||
export const getTestScriptList = (params: TestScript.ReqTestScriptParams) => {
|
||||
return http.post<ResPage<TestScript.TestScriptBO>>(`/testScript/list`, params)
|
||||
// return http.post<ResPage<Role.ResRoleList>>(`${rePrefix}/testScript/list`, params)
|
||||
export const getPqScriptList = (params: TestScript.ReqTestScriptParams) => {
|
||||
return http.post(`/pqScript/list`, params)
|
||||
}
|
||||
|
||||
|
||||
//升级为模版
|
||||
export const updatePqScript = (params: TestScript.ResTestScript) => {
|
||||
return http.get(`/pqScript/upgradeToTemplate?id=${params.id}`)
|
||||
}
|
||||
|
||||
//删除检测脚本
|
||||
export const deletePqScript = (params: string[]) => {
|
||||
return http.post(`/pqScript/delete`, params)
|
||||
}
|
||||
|
||||
17
frontend/src/api/system/base/index.ts
Normal file
17
frontend/src/api/system/base/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import http from '@/api'
|
||||
import {type Base} from '@/api/system/base/interface'
|
||||
|
||||
//获取检测配置
|
||||
export const getTestConfig = () => {
|
||||
return http.get(`/sysTestConfig/getConfig`)
|
||||
}
|
||||
|
||||
|
||||
//编辑检测配置
|
||||
export const updateTestConfig = (params: Base.ResTestConfig) => {
|
||||
return http.post(`/sysTestConfig/update`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
19
frontend/src/api/system/base/interface/index.ts
Normal file
19
frontend/src/api/system/base/interface/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
// 检测配置表模块
|
||||
export namespace Base {
|
||||
|
||||
/**
|
||||
* 检测配置表查询返回的对象
|
||||
*/
|
||||
export interface ResTestConfig {
|
||||
id: string; //系统配置表Id
|
||||
autoGenerate:number;//检测报告是否自动生成0 否;1是
|
||||
maxTime:number;//最大复检次数,默认3次
|
||||
dataRule:string;//数据处理原则,关联字典(所有值、部分值、cp95值、平均值、任意值),默认任意值
|
||||
state: number; //状态
|
||||
createBy?: string| null; //创建用户
|
||||
createTime?: string| null; //创建时间
|
||||
updateBy?: string| null; //更新用户
|
||||
updateTime?: string| null; //更新时间
|
||||
|
||||
}
|
||||
}
|
||||
13
frontend/src/api/system/versionRegister/index.ts
Normal file
13
frontend/src/api/system/versionRegister/index.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import http from '@/api'
|
||||
import {type VersionRegister} from '@/api/system/versionRegister/interface'
|
||||
|
||||
//获取有效数据配置
|
||||
export const getRegRes = (params: VersionRegister.ResSys_Reg_Res) => {
|
||||
return http.get(`/sysRegRes/getRegResByType?id=${params.type}`)
|
||||
}
|
||||
|
||||
|
||||
//编辑有效数据配置
|
||||
export const updateRegRes = (params: VersionRegister.Sys_Reg_Res) => {
|
||||
return http.post(`/sysRegRes/update`, params)
|
||||
}
|
||||
31
frontend/src/api/system/versionRegister/interface/index.ts
Normal file
31
frontend/src/api/system/versionRegister/interface/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
// 检测配置表模块
|
||||
export namespace VersionRegister {
|
||||
|
||||
/**
|
||||
* 检测配置表查询返回的对象
|
||||
*/
|
||||
export interface ResSys_Reg_Res {
|
||||
id: string; //版本注册表Id
|
||||
type: string; //版本类型(模拟式、数字式、比对式)
|
||||
code: string; //注册码
|
||||
licenseKey: string; //密钥
|
||||
expireDate: string; //到期时间
|
||||
waveRecord?: number;
|
||||
realTime?: number;
|
||||
statistics?: number;
|
||||
flicker?: number;
|
||||
state: number; //状态
|
||||
createBy?: string| null; //创建用户
|
||||
createTime?: string| null; //创建时间
|
||||
updateBy?: string| null; //更新用户
|
||||
updateTime?: string| null; //更新时间
|
||||
}
|
||||
|
||||
export interface Sys_Reg_Res {
|
||||
id: string;
|
||||
waveRecord?: number;
|
||||
realTime?: number;
|
||||
statistics?: number;
|
||||
flicker?: number;
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ export default {
|
||||
personalData: "Personal Data",
|
||||
changePassword: "Change Password",
|
||||
changeMode:"Change Mode",
|
||||
versionRegister:"Version Register",
|
||||
logout: "Logout"
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,6 +25,7 @@ export default {
|
||||
personalData: "个人信息",
|
||||
changePassword: "修改密码",
|
||||
changeMode:"模式切换",
|
||||
versionRegister:"版本注册",
|
||||
logout: "退出登录"
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
<el-dropdown-item @click="changeMode">
|
||||
<el-icon><Edit /></el-icon>{{ $t("header.changeMode") }}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click="openDialog('versionRegisterRef')">
|
||||
<el-icon><SetUp /></el-icon>{{ $t("header.versionRegister") }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
@@ -29,6 +32,8 @@
|
||||
<InfoDialog ref="infoRef"></InfoDialog>
|
||||
<!-- passwordDialog -->
|
||||
<PasswordDialog ref="passwordRef"></PasswordDialog>
|
||||
<!-- versionRegisterDialog -->
|
||||
<VersionDialog ref="versionRegisterRef"></VersionDialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -40,6 +45,7 @@ import { useUserStore } from "@/stores/modules/user";
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import InfoDialog from "./InfoDialog.vue";
|
||||
import PasswordDialog from "./PasswordDialog.vue";
|
||||
import VersionDialog from "@/views/system/versionRegister/index.vue";
|
||||
import { computed } from "vue";
|
||||
import { Avatar } from "@element-plus/icons-vue";
|
||||
import AssemblySize from "./components/AssemblySize.vue";
|
||||
@@ -79,9 +85,12 @@ const logout = () => {
|
||||
// 打开修改密码和个人信息弹窗
|
||||
const infoRef = ref<InstanceType<typeof InfoDialog> | null>(null);
|
||||
const passwordRef = ref<InstanceType<typeof PasswordDialog> | null>(null);
|
||||
const versionRegisterRef = ref<InstanceType<typeof VersionDialog> | null>(null);
|
||||
|
||||
const openDialog = (ref: string) => {
|
||||
if (ref == "infoRef") infoRef.value?.openDialog();
|
||||
if (ref == "passwordRef") passwordRef.value?.openDialog();
|
||||
if (ref == "versionRegisterRef") versionRegisterRef.value?.openDialog();
|
||||
};
|
||||
//模式切换
|
||||
const changeMode = () => {
|
||||
|
||||
26
frontend/src/stores/modules/mode.ts
Normal file
26
frontend/src/stores/modules/mode.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
// src/stores/modules/mode.ts
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
// export const useModeStore = defineStore('mode', {
|
||||
// state: () => ({
|
||||
// currentMode: '' as string,
|
||||
// }),
|
||||
// actions: {
|
||||
// setCurrentMode(modeName: string) {
|
||||
// this.currentMode = modeName;
|
||||
// },
|
||||
// },
|
||||
// });
|
||||
|
||||
|
||||
export const useModeStore = defineStore('mode', {
|
||||
state: () => ({
|
||||
currentMode: localStorage.getItem('currentMode') || '' as string,
|
||||
}),
|
||||
actions: {
|
||||
setCurrentMode(modeName: string) {
|
||||
this.currentMode = modeName;
|
||||
localStorage.setItem('currentMode', modeName); // 保存到 localStorage
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -124,12 +124,21 @@ const resetFormContent = () => {
|
||||
const formRuleRef = ref<FormInstance>()
|
||||
const rules : Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
name :[{required:true,trigger:'blur',message:'菜单名称必填!'}],
|
||||
path :[{required:true,trigger:'blur',message:'菜单路径必填!'}],
|
||||
type :[{required:true,trigger:'change',message:'菜单类型必选!'}],
|
||||
component :[{required:true,trigger:'blur',message:'组件地址必填!'}],
|
||||
code :[{required:true,trigger:'blur',message:'编码必填!'}]
|
||||
})
|
||||
|
||||
watch(() => formContent.value.type, (newVal) => {
|
||||
if (newVal === 1) {
|
||||
// 选择按钮时,路由地址和组件地址无需校验
|
||||
rules.value.path = [];
|
||||
rules.value.component = [];
|
||||
} else {
|
||||
// 其他情况下,路由地址和组件地址需要校验
|
||||
rules.value.path = [{ required: true, trigger: 'blur', message: '路由地址必填!' }];
|
||||
rules.value.component = [{ required: true, trigger: 'blur', message: '组件地址必填!' }];
|
||||
}
|
||||
});
|
||||
|
||||
// 关闭弹窗
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
@@ -155,7 +164,7 @@ const displayPid = computed({
|
||||
const save = () => {
|
||||
try {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
console.log(formContent.value)
|
||||
|
||||
if (formContent.value.pid === undefined || formContent.value.pid === null || formContent.value.pid === '') {
|
||||
formContent.value.pid = '0';
|
||||
}
|
||||
|
||||
@@ -160,7 +160,6 @@
|
||||
LoginNameIsShow.value = true
|
||||
formContent.value = { ...data }
|
||||
|
||||
console.log(formContent.value,111);
|
||||
|
||||
} else {
|
||||
IsPasswordShow.value = true
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
<template>
|
||||
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" v-bind="dialogBig">
|
||||
<div class="change-errsys-dialog">
|
||||
<div class="change-errsys-title">
|
||||
<el-form-item label="设备名称:" >
|
||||
<el-input v-model='deviceName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="检测脚本:" >
|
||||
<el-input v-model='testScriptName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据处理原则" >
|
||||
<el-input v-model='dataRule' :disabled="true"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="误差体系">
|
||||
<el-select v-model="error_Sys_Id" autocomplete="off">
|
||||
<el-option
|
||||
v-for="plan in testErrSystDataList"
|
||||
:key="plan.id"
|
||||
:label="plan.label"
|
||||
:value="plan.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-button type="primary" :icon="VideoPlay">数据计算</el-button>
|
||||
<el-button type="primary" :icon="Postcard" @click="openReportDlg">报告生成</el-button>
|
||||
</div>
|
||||
<div class="change-errsys-content">
|
||||
<div class="tabs-title"><el-button type="primary" loading >合格92项/共103项</el-button> </div>
|
||||
<el-table :data="testData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border>
|
||||
<el-table-column fixed prop="deviceName" label="检测项目" />
|
||||
<el-table-column prop="updataTime" label="被检通道1" />
|
||||
<el-table-column prop="ErrorValue" label="被检通道2" />
|
||||
<el-table-column prop="Result" label="被检通道3" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<ReportPopup :visible="reportDialogVisible" @update:visible="reportDialogVisible = $event"></ReportPopup>
|
||||
</el-dialog>
|
||||
|
||||
</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 { useDictStore } from '@/stores/modules/dict'
|
||||
import { CirclePlus, Delete, EditPen,Postcard, VideoPlay} from '@element-plus/icons-vue'
|
||||
// 使用 dayjs 库格式化
|
||||
import dayjs from 'dayjs'
|
||||
import { getPqMonList } from '@/api/device/monitor'
|
||||
import { type ColumnProps } from '@/components/ProTable/interface'
|
||||
import { type Monitor } from '@/api/device/interface/monitor'
|
||||
import { data } from "@/api/plan/autoTest.json";
|
||||
import DataCheckResultTable from './dataCheckResultTable.vue'
|
||||
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
|
||||
import {dictPattern,dictTestState,dictReportState,dictResult,testPlanDataList,sourceDataList,deviceDataList,testSoureDataList,testScriptDataList,testErrSystDataList,planData,testFatherPlanList} from '@/api/plan/planData'
|
||||
import ReportPopup from './reportPopup.vue'
|
||||
|
||||
const reportDialogVisible = ref(false)
|
||||
const deviceName = ref('被检设备1');
|
||||
const error_Sys_Id = ref('2');
|
||||
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
|
||||
const errorSysName = ref('Q/GDW 10650.2-2021');
|
||||
const dataRule = ref('所有值');
|
||||
const scriptSwitch = ref(true);
|
||||
const currentScriptDsc = ref('频率准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
const defaultProps = {
|
||||
children: "children",
|
||||
label: "name",
|
||||
pid: "pid",
|
||||
};
|
||||
|
||||
const testData = ref([
|
||||
{
|
||||
deviceName: '额定条件下频率检测42.5Hz',
|
||||
updataTime: '√',
|
||||
ErrorValue:'×',
|
||||
Result: '/',
|
||||
},
|
||||
{
|
||||
deviceName: '额定条件下频率检测50Hz',
|
||||
updataTime: '/',
|
||||
ErrorValue:'√',
|
||||
Result: '×',
|
||||
},
|
||||
{
|
||||
deviceName: '额定条件下频率检测50.05Hz',
|
||||
updataTime: '—',
|
||||
ErrorValue:'—',
|
||||
Result: '—',
|
||||
},
|
||||
{
|
||||
deviceName: '额定条件下频率检测57.5Hz',
|
||||
updataTime: '—',
|
||||
ErrorValue:'—',
|
||||
Result: '—',
|
||||
},
|
||||
])
|
||||
|
||||
const handleNodeClick = (data) => {
|
||||
console.log(data);
|
||||
};
|
||||
const MonIsShow = ref(false)
|
||||
const DevIsShow = ref(false)
|
||||
const IsPasswordShow = ref(false)
|
||||
const dictStore = useDictStore()
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
const disabledDate = (time: Date) => {
|
||||
return time.getTime() > Date.now()
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'submit', data: any): void;
|
||||
}>();
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
};
|
||||
|
||||
const openReportDlg = () => {
|
||||
reportDialogVisible.value = true
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.change-errsys-dialog{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.change-errsys-title{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.change-errsys-content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tabs-title{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
</style>
|
||||
173
frontend/src/views/home/components/dataCheckPopup.vue
Normal file
173
frontend/src/views/home/components/dataCheckPopup.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" v-bind="dialogBig">
|
||||
<div class="data-check-dialog">
|
||||
<div class="data-check-title">
|
||||
<el-form-item label="检测脚本:" >
|
||||
<el-input v-model='testScriptName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="误差体系" >
|
||||
<el-input v-model='errorSysName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据处理原则" >
|
||||
<el-input v-model='dataRule' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称:" >
|
||||
<el-input v-model='deviceName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label='通道号:'>
|
||||
<el-select v-model="monitorIdx">
|
||||
<el-option
|
||||
v-for="item in monitorIdxList"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="data-check-content">
|
||||
<div class="content-left-tree">
|
||||
<div class="content-left-tree-switch">
|
||||
<el-switch
|
||||
v-model="scriptSwitch"
|
||||
class="ml-2"
|
||||
inline-prompt
|
||||
style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
|
||||
active-text="仅显示不合格测试项"
|
||||
inactive-text="显示全部测试项"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<el-tree
|
||||
default-expand-all
|
||||
:data="data"
|
||||
:props="defaultProps"
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-right">
|
||||
<div class="content-right-title">
|
||||
<el-divider >当前检测项目:</el-divider>
|
||||
<span>{{currentScriptDsc}}</span>
|
||||
</div>
|
||||
<div class="content-right-Tabs">
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="检测结果">
|
||||
<DataCheckResultTable></DataCheckResultTable>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="原始数据">
|
||||
<DataCheckRawDataTable></DataCheckRawDataTable>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</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 { useDictStore } from '@/stores/modules/dict'
|
||||
import { CirclePlus, Delete, EditPen } from '@element-plus/icons-vue'
|
||||
// 使用 dayjs 库格式化
|
||||
import dayjs from 'dayjs'
|
||||
import { getPqMonList } from '@/api/device/monitor'
|
||||
import { type ColumnProps } from '@/components/ProTable/interface'
|
||||
import { type Monitor } from '@/api/device/interface/monitor'
|
||||
import { data } from "@/api/plan/autoTest.json";
|
||||
import DataCheckResultTable from './dataCheckResultTable.vue'
|
||||
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
|
||||
|
||||
const deviceName = ref('被检设备1');
|
||||
const monitorIdx = ref('1');
|
||||
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
|
||||
const errorSysName = ref('Q/GDW 10650.2-2021');
|
||||
const dataRule = ref('所有值');
|
||||
const scriptSwitch = ref(true);
|
||||
const currentScriptDsc = ref('频率准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
const defaultProps = {
|
||||
children: "children",
|
||||
label: "name",
|
||||
pid: "pid",
|
||||
};
|
||||
|
||||
const monitorIdxList = [
|
||||
{
|
||||
value: '1',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
},
|
||||
]
|
||||
const handleNodeClick = (data) => {
|
||||
console.log(data);
|
||||
};
|
||||
const MonIsShow = ref(false)
|
||||
const DevIsShow = ref(false)
|
||||
const IsPasswordShow = ref(false)
|
||||
const dictStore = useDictStore()
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
const disabledDate = (time: Date) => {
|
||||
return time.getTime() > Date.now()
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'submit', data: any): void;
|
||||
}>();
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.data-check-dialog{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.data-check-title{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.data-check-content{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.content-left-tree{
|
||||
width: 20%;
|
||||
}
|
||||
.content-left-tree-switch{
|
||||
text-align: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.content-right{
|
||||
margin-left: 20px;
|
||||
}
|
||||
.content-right-Tabs{
|
||||
margin-top: 15px;
|
||||
}
|
||||
</style>
|
||||
133
frontend/src/views/home/components/dataCheckRawDataTable.vue
Normal file
133
frontend/src/views/home/components/dataCheckRawDataTable.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData" stripe height="300" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" >
|
||||
|
||||
<el-table-column prop="id" label="序号" width="70" />
|
||||
<el-table-column prop="updateTime" label="数据时间" />
|
||||
<el-table-column prop="L1" label="L1" />
|
||||
<el-table-column prop="L2" label="L2" />
|
||||
<el-table-column prop="L3" label="L3" />
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup>
|
||||
import{ElMessage, FormInstance,FormItemRule}from'element-plus'
|
||||
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
|
||||
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
|
||||
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
||||
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
const tableData = ref([
|
||||
{
|
||||
id: 1,
|
||||
updateTime: "2024-10-10 09:30:00",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
updateTime: "2024-10-10 09:30:03",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
updateTime: "2024-10-10 09:30:06",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
updateTime: "2024-10-10 09:30:09",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
updateTime: "2024-10-10 09:30:12",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
updateTime: "2024-10-10 09:30:15",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
updateTime: "2024-10-10 09:30:18",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
updateTime: "2024-10-10 09:30:21",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
updateTime: "2024-10-10 09:30:24",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
updateTime: "2024-10-10 09:30:27",
|
||||
L1:57.73,
|
||||
L2:57.73,
|
||||
L3:57.73,
|
||||
},
|
||||
])
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.form-grid {
|
||||
display: flex;
|
||||
flex-direction: row; /* 横向排列 */
|
||||
flex-wrap: wrap; /* 允许换行 */
|
||||
}
|
||||
.form-grid .el-form-item {
|
||||
flex: 1 1 30%; /* 控件宽度 */
|
||||
margin-right: 20px; /* 控件间距 */
|
||||
}
|
||||
.form-grid .el-form-item:last-child {
|
||||
margin-right: 0; /* 最后一个控件不需要右边距 */
|
||||
}
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 10px; /* 调整这里的值以增加或减少间距 */
|
||||
}
|
||||
.el-tabs {
|
||||
margin-bottom: 20px; /* 添加底部边距 */
|
||||
}
|
||||
|
||||
.el-table th, .el-table td {
|
||||
text-align: center; /* 所有单元格文字居中 */
|
||||
}
|
||||
|
||||
.table-container {
|
||||
max-height: 400px; /* 根据需要调整高度 */
|
||||
overflow-y: auto; /* 允许垂直滚动 */
|
||||
overflow-x: hidden; /* 隐藏水平滚动条 */
|
||||
}
|
||||
</style>
|
||||
102
frontend/src/views/home/components/dataCheckResultTable.vue
Normal file
102
frontend/src/views/home/components/dataCheckResultTable.vue
Normal file
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
|
||||
<div class="table-container">
|
||||
<el-table :data="tableData" max-height="300" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" >
|
||||
|
||||
<el-table-column prop="id" label="序号" width="70" />
|
||||
<el-table-column prop="standardValue" label="标准值" />
|
||||
|
||||
<el-table-column label="L1" >
|
||||
<el-table-column prop="L1" label="被检值">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="L1_errValue" label="误差值">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="L2" >
|
||||
<el-table-column prop="L2" label="被检值">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="L2_errValue" label="误差值">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="L3" >
|
||||
<el-table-column prop="L3" label="被检值">
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column prop="L3_errValue" label="误差值">
|
||||
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="Result" label="检测结果">
|
||||
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script lang="tsx" setup>
|
||||
import{ElMessage, FormInstance,FormItemRule}from'element-plus'
|
||||
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
|
||||
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
|
||||
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
||||
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument} from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
|
||||
const tableData = ref([
|
||||
{
|
||||
id: '1',
|
||||
standardValue: 57.74,
|
||||
L1:57.73,
|
||||
L1_errValue: 0.01,
|
||||
L2:57.73,
|
||||
L2_errValue: 0.01,
|
||||
L3:57.73,
|
||||
L3_errValue: 0.01,
|
||||
Result: '合格',
|
||||
},
|
||||
|
||||
])
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
.form-grid {
|
||||
display: flex;
|
||||
flex-direction: row; /* 横向排列 */
|
||||
flex-wrap: wrap; /* 允许换行 */
|
||||
}
|
||||
.form-grid .el-form-item {
|
||||
flex: 1 1 30%; /* 控件宽度 */
|
||||
margin-right: 20px; /* 控件间距 */
|
||||
}
|
||||
.form-grid .el-form-item:last-child {
|
||||
margin-right: 0; /* 最后一个控件不需要右边距 */
|
||||
}
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 10px; /* 调整这里的值以增加或减少间距 */
|
||||
}
|
||||
.el-tabs {
|
||||
margin-bottom: 20px; /* 添加底部边距 */
|
||||
}
|
||||
|
||||
.el-table th, .el-table td {
|
||||
text-align: center; /* 所有单元格文字居中 */
|
||||
}
|
||||
|
||||
.table-container {
|
||||
max-height: 400px; /* 根据需要调整高度 */
|
||||
overflow-y: auto; /* 允许垂直滚动 */
|
||||
overflow-x: hidden; /* 隐藏水平滚动条 */
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,156 @@
|
||||
<template>
|
||||
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" v-bind="dialogBig">
|
||||
<div class="data-check-dialog">
|
||||
<div class="data-check-title">
|
||||
<el-form-item label="检测脚本:" >
|
||||
<el-input v-model='testScriptName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="误差体系" >
|
||||
<el-input v-model='errorSysName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据处理原则" >
|
||||
<el-input v-model='dataRule' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备名称:" >
|
||||
<el-input v-model='deviceName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="通道号:" >
|
||||
<el-input v-model='monitorIdx' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label='通道号:'>
|
||||
<el-select v-model="monitorIdx">
|
||||
<el-option
|
||||
v-for="item in monitorIdxList"
|
||||
:key="item.value"
|
||||
:label="item.value"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</div>
|
||||
<div class="data-check-content">
|
||||
<div class="content-right">
|
||||
<div class="content-right-title">
|
||||
<el-divider >当前检测项目:</el-divider>
|
||||
<span>{{currentScriptDsc}}</span>
|
||||
</div>
|
||||
<div class="content-right-Tabs">
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="检测结果">
|
||||
<DataCheckResultTable></DataCheckResultTable>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="原始数据">
|
||||
<DataCheckRawDataTable></DataCheckRawDataTable>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</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 { useDictStore } from '@/stores/modules/dict'
|
||||
import { CirclePlus, Delete, EditPen } from '@element-plus/icons-vue'
|
||||
// 使用 dayjs 库格式化
|
||||
import dayjs from 'dayjs'
|
||||
import { getPqMonList } from '@/api/device/monitor'
|
||||
import { type ColumnProps } from '@/components/ProTable/interface'
|
||||
import { type Monitor } from '@/api/device/interface/monitor'
|
||||
import { data } from "@/api/plan/autoTest.json";
|
||||
import DataCheckResultTable from './dataCheckResultTable.vue'
|
||||
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
|
||||
|
||||
const deviceName = ref('被检设备1');
|
||||
const monitorIdx = ref('1');
|
||||
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
|
||||
const errorSysName = ref('Q/GDW 10650.2-2021');
|
||||
const dataRule = ref('所有值');
|
||||
const scriptSwitch = ref(true);
|
||||
const currentScriptDsc = ref('频率准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
const defaultProps = {
|
||||
children: "children",
|
||||
label: "name",
|
||||
pid: "pid",
|
||||
};
|
||||
|
||||
const monitorIdxList = [
|
||||
{
|
||||
value: '1',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
},
|
||||
]
|
||||
const handleNodeClick = (data) => {
|
||||
console.log(data);
|
||||
};
|
||||
const MonIsShow = ref(false)
|
||||
const DevIsShow = ref(false)
|
||||
const IsPasswordShow = ref(false)
|
||||
const dictStore = useDictStore()
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
const disabledDate = (time: Date) => {
|
||||
return time.getTime() > Date.now()
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'submit', data: any): void;
|
||||
}>();
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.data-check-dialog{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.data-check-title{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.data-check-content{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.content-left-tree{
|
||||
width: 20%;
|
||||
}
|
||||
.content-left-tree-switch{
|
||||
text-align: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.content-right{
|
||||
margin-left: 20px;
|
||||
}
|
||||
.content-right-Tabs{
|
||||
margin-top: 15px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,64 +1,18 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="预检测项目:">
|
||||
<div class="form-grid">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in detectionOptions"
|
||||
v-model="item.selected"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
></el-checkbox
|
||||
>
|
||||
<!-- <el-form :model="formData" ref='formRuleRef' :rules='rules'>
|
||||
<el-row :gutter="120" >
|
||||
<el-col :span="9">
|
||||
<el-form-item label="误差体系名称" prop="name">
|
||||
<el-input v-model='formData.name' placeholder="标准号+年份+设备等级"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="参照标准名称" prop="standard_Name">
|
||||
<el-input v-model='formData.standard_Name'/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="7">
|
||||
<el-form-item label="发布时间" prop="standard_Time">
|
||||
<el-input v-model="formData.standard_Time" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="120" >
|
||||
<el-col :span="9">
|
||||
<el-form-item label="适用设备等级" prop="dev_Level">
|
||||
<el-select v-model='formData.dev_Level' placeholder="请选择设备等级">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('errorLevel')"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="状态" prop="enable">
|
||||
<el-select v-model='formData.enable' placeholder="请选择状态">
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('status')"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form> -->
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-tab-pane label="预检测项目:">
|
||||
<div class="form-grid">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in detectionOptions"
|
||||
v-model="item.selected"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
></el-checkbox
|
||||
>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<div class = "test-dialog">
|
||||
<div class="dialog-left">
|
||||
@@ -71,7 +25,7 @@
|
||||
</el-steps>
|
||||
</div>
|
||||
<div class="dialog-right">
|
||||
<el-collapse :v-model="1" accordion>
|
||||
<el-collapse :v-model="activeIndex" accordion>
|
||||
<el-collapse-item title="源通讯校验" name="1">
|
||||
<div>
|
||||
暂无数据,等待检测开始
|
||||
@@ -79,39 +33,20 @@
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="设备通讯校验" name="2">
|
||||
<div>
|
||||
Operation feedback: enable the users to clearly perceive their
|
||||
operations by style updates and interactive effects;
|
||||
</div>
|
||||
<div>
|
||||
Visual feedback: reflect current state by updating or rearranging
|
||||
elements of the page.
|
||||
暂无数据,等待检测开始
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="协议校验" name="3">
|
||||
<div>
|
||||
Simplify the process: keep operating process simple and intuitive;
|
||||
</div>
|
||||
<div>
|
||||
Definite and clear: enunciate your intentions clearly so that the
|
||||
users can quickly understand and make decisions;
|
||||
</div>
|
||||
<div>
|
||||
Easy to identify: the interface should be straightforward, which helps
|
||||
the users to identify and frees them from memorizing and recalling.
|
||||
暂无数据,等待检测开始
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="相序校验" name="4">
|
||||
<div>
|
||||
Decision making: giving advices about operations is acceptable, but do
|
||||
not make decisions for the users;
|
||||
</div>
|
||||
<div>
|
||||
Controlled consequences: users should be granted the freedom to
|
||||
operate, including canceling, aborting or terminating current
|
||||
operation.
|
||||
暂无数据,等待检测开始
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</el-collapse>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
137
frontend/src/views/home/components/reportPopup.vue
Normal file
137
frontend/src/views/home/components/reportPopup.vue
Normal file
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<el-dialog title="报告生成" :model-value='visible' @close="handleCancel" v-bind="dialogBig">
|
||||
<div class="report-dialog">
|
||||
<div class="report-title">
|
||||
<el-form-item label="检测脚本:" >
|
||||
<el-input v-model='testScriptName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="误差体系" >
|
||||
<el-input v-model='errorSysName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据处理原则" >
|
||||
<el-input v-model='dataRule' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="报告模板" >
|
||||
<el-input v-model='reportTemplate' :disabled="true"/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="report-content">
|
||||
<div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="报告生成状态表:">
|
||||
<div class="form-grid">
|
||||
<div class="tabs-title"><el-button type="primary" loading >已生成2台/共4台</el-button> </div>
|
||||
<el-table :data="reportData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border class="custom-table">
|
||||
<el-table-column prop="id" label="序号" />
|
||||
<el-table-column prop="deviceName" label="设备名称" />
|
||||
<el-table-column label="生成进度">
|
||||
<template #default="scope">
|
||||
<el-progress :color="customColors" :percentage="scope.row.processValue" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="action" label="操作" >
|
||||
<template #default="scope">
|
||||
<el-button type='primary' link :icon='View'> 查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</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 { useDictStore } from '@/stores/modules/dict'
|
||||
import { CirclePlus, Delete, EditPen,View } from '@element-plus/icons-vue'
|
||||
|
||||
|
||||
|
||||
const reportTemplate = ref('国网检测模板V1.0');
|
||||
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
|
||||
const errorSysName = ref('Q/GDW 10650.2-2021');
|
||||
const dataRule = ref('所有值');
|
||||
const scriptSwitch = ref(true);
|
||||
const currentScriptDsc = ref('频率准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°');
|
||||
|
||||
const reportData = ref([
|
||||
{ id: '1', deviceName: '被检设备1', processValue: '100' , action:'查看' },
|
||||
{ id: '2', deviceName: '被检设备2', processValue: '100' , action:'查看' },
|
||||
{ id: '3', deviceName: '被检设备3', processValue: '10', action:'查看' },
|
||||
])
|
||||
const customColors = [
|
||||
{ color: "red", percentage: 0 },
|
||||
{ color: "red", percentage: 10 },
|
||||
{ color: "red", percentage: 20 },
|
||||
{ color: "red", percentage: 30 }, //红
|
||||
{ color: "red", percentage: 40 },
|
||||
{ color: "#e6a23c", percentage: 50 },
|
||||
{ color: "#e6a23c", percentage: 60 },
|
||||
{ color: "#e6a23c", percentage: 70 }, //黄
|
||||
{ color: "#e6a23c", percentage: 80 }, //1989fa
|
||||
{ color: "#e6a23c", percentage: 90 }, //1989fa
|
||||
{ color: "#5cb87a", percentage: 100 }, //绿
|
||||
];
|
||||
const handleNodeClick = (data) => {
|
||||
console.log(data);
|
||||
};
|
||||
const MonIsShow = ref(false)
|
||||
const DevIsShow = ref(false)
|
||||
const IsPasswordShow = ref(false)
|
||||
const dictStore = useDictStore()
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
const disabledDate = (time: Date) => {
|
||||
return time.getTime() > Date.now()
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'submit', data: any): void;
|
||||
}>();
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
.report-dialog{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.report-title{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.report-content{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.tabs-title{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.el-tabs__content{
|
||||
padding-top: 5px !important;
|
||||
}
|
||||
</style>
|
||||
114
frontend/src/views/home/components/resultPopup.vue
Normal file
114
frontend/src/views/home/components/resultPopup.vue
Normal file
@@ -0,0 +1,114 @@
|
||||
<template>
|
||||
<el-dialog title="检测结果" :model-value="visible" @close="handleCancel" v-bind="dialogBig" width="895px">
|
||||
<div class="result-dialog">
|
||||
<div class="result-title">
|
||||
<el-row>
|
||||
<el-form-item label="检测脚本:" >
|
||||
<el-input v-model='testScriptName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="误差体系" >
|
||||
<el-input v-model='errorSysName' :disabled="true"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="数据处理原则" >
|
||||
<el-input v-model='dataRule' :disabled="true"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</div>
|
||||
<div class="result-content">
|
||||
<el-table :data="resultData" stripe max-height="350" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border v-on:cell-click="handleClick">
|
||||
<el-table-column prop="deviceName" label="被检设备" />
|
||||
<el-table-column prop="result_1" label="通道1" />
|
||||
<el-table-column prop="result_2" label="通道2" />
|
||||
<el-table-column prop="result_3" label="通道3" />
|
||||
<el-table-column prop="result_4" label="通道4" />
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="result-footer">
|
||||
你可以停留在本页查看数据,或返回首页进行复检、报告生成和归档
|
||||
</div>
|
||||
</div>
|
||||
<DataCheckPopup
|
||||
:visible="DataCheckDialogVisible"
|
||||
@update:visible="DataCheckDialogVisible = $event"
|
||||
></DataCheckPopup>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="testPopup">
|
||||
import{ElMessage, ElSelectV2, FormInstance,FormItemRule}from'element-plus'
|
||||
import { defineProps, defineEmits, reactive,watch,ref, Ref } from 'vue';
|
||||
import { dialogBig,dialogMiddle} from '@/utils/elementBind'
|
||||
//import IndicatorTypeDialog from "@/views/machine/errorSystem/components/IndicatorTypeDialog.vue"; // 导入子组件
|
||||
import {CirclePlus, Delete, EditPen,FolderOpened,CopyDocument,Edit, Picture, UploadFilled, SuccessFilled,VideoPlay,Right,Refresh,Close} from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import preTest from './preTest.vue'
|
||||
import timeTest from './timeTest.vue'
|
||||
import channelsTest from './channelsTest.vue'
|
||||
import DataCheckPopup from './dataCheckPopup.vue';
|
||||
import { log } from 'console';
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', value: boolean): void;
|
||||
(e: 'submit', data: any): void;
|
||||
}>();
|
||||
|
||||
const testScriptName = ref('Q/GDW 10650.4-2021 模拟式');
|
||||
const errorSysName = ref('Q/GDW 10650.2-2021');
|
||||
const dataRule = ref('所有值');
|
||||
const DataCheckDialogVisible = ref(false);
|
||||
|
||||
const resultData = ref([
|
||||
{
|
||||
deviceName: "被检设备1",
|
||||
result_1: "合格",
|
||||
result_2: "合格",
|
||||
result_3: "合格",
|
||||
result_4: "合格",
|
||||
},
|
||||
{
|
||||
deviceName: "被检设备2",
|
||||
result_1: "合格",
|
||||
result_2: "合格",
|
||||
result_3: "—",
|
||||
result_4: "—",
|
||||
},
|
||||
{
|
||||
deviceName: "被检设备3",
|
||||
result_1: "不合格",
|
||||
result_2: "合格",
|
||||
result_3: "—",
|
||||
result_4: "—",
|
||||
},
|
||||
]);
|
||||
|
||||
const handleClick = (row:any) => {
|
||||
console.log(111)
|
||||
DataCheckDialogVisible.value = true;
|
||||
};
|
||||
|
||||
const handleCancel = () => {
|
||||
emit('update:visible', false); // 关闭对话框
|
||||
};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.result-dialog{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.result-title{
|
||||
/* display: flex;
|
||||
flex-direction: row; */
|
||||
}
|
||||
.result-footer{
|
||||
text-align: right;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -134,10 +134,18 @@
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:icon="EditPen"
|
||||
@click="openDrawer('误差体系编辑', scope.row)"
|
||||
:icon="PieChart"
|
||||
@click="openDrawer('检测数据查询', scope.row)"
|
||||
v-if="form.activeTabs === 5"
|
||||
>误差体系编辑</el-button
|
||||
>检测数据查询</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:icon="Switch"
|
||||
@click="openDrawer('误差体系更换', scope.row)"
|
||||
v-if="form.activeTabs === 5"
|
||||
>误差体系更换</el-button
|
||||
>
|
||||
<!-- <el-button
|
||||
dictType="primary"
|
||||
@@ -156,6 +164,21 @@
|
||||
:dialogTitle="dialogTitle"
|
||||
@update:visible="dialogFormVisible = $event"
|
||||
/>
|
||||
|
||||
<reportPopup
|
||||
:visible="reportDialogVisible"
|
||||
@update:visible="reportDialogVisible = $event"
|
||||
></reportPopup>
|
||||
|
||||
<dataCheckPopup
|
||||
:visible="dataCheckDialogVisible"
|
||||
@update:visible="dataCheckDialogVisible = $event"
|
||||
></dataCheckPopup>
|
||||
|
||||
<dataCheckChangeErrSysPopup
|
||||
:visible="dataCheckChangeErrSysDialogVisible"
|
||||
@update:visible="dataCheckChangeErrSysDialogVisible = $event"
|
||||
></dataCheckChangeErrSysPopup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -167,11 +190,15 @@ import { ElMessage, ElMessageBox, ElLoading} from "element-plus";
|
||||
import ProTable from "@/components/ProTable/index.vue";
|
||||
import { type ProTableInstance, type ColumnProps } from '@/components/ProTable/interface'
|
||||
import {
|
||||
Search,View,EditPen,Clock,ChatLineRound,ChatLineSquare,ChatDotSquare,Postcard,Notebook
|
||||
Search,View,EditPen,Clock,ChatLineRound,ChatLineSquare,ChatDotSquare,Postcard,Notebook,Switch,PieChart
|
||||
} from "@element-plus/icons-vue";
|
||||
import { getPlanList } from "@/api/plan/planList";
|
||||
import deviceDataList from '@/api/device/device/deviceData'
|
||||
import testPopup from "./testPopup.vue";
|
||||
import reportPopup from "./reportPopup.vue";
|
||||
import dataCheckPopup from "./dataCheckPopup.vue";
|
||||
import dataCheckChangeErrSysPopup from "./dataCheckChangeErrSysPopup.vue";
|
||||
|
||||
import { log } from "console";
|
||||
import { isVisible } from "element-plus/es/utils";
|
||||
import { reactive, ref } from "vue";
|
||||
@@ -180,6 +207,9 @@ const value1 = ref("");
|
||||
const value2 = ref("");
|
||||
const tableHeight = ref(0);
|
||||
const dialogFormVisible = ref(false)
|
||||
const reportDialogVisible = ref(false)
|
||||
const dataCheckDialogVisible = ref(false)
|
||||
const dataCheckChangeErrSysDialogVisible = ref(false)
|
||||
const dialogTitle = ref('手动检测')
|
||||
const dialogForm = ref<any>({
|
||||
id: '',
|
||||
@@ -354,12 +384,12 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
label: '设备名称',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
prop: 'dev_Type',
|
||||
label: '类型',
|
||||
label: '设备类型',
|
||||
minWidth: 100,
|
||||
},
|
||||
{
|
||||
@@ -735,19 +765,31 @@ const handleTest = () => {
|
||||
|
||||
// 打开 drawer(新增、查看、编辑)
|
||||
const openDrawer = (title: string, row: any) => {
|
||||
if (title === '查看')
|
||||
{
|
||||
console.log(title);
|
||||
const link = document.createElement('a');
|
||||
const fileUrl = 'G:/南网数研院非结构化数据生成程序MMS_JSON修改记录.docx'; // 文件路径
|
||||
link.href = fileUrl;
|
||||
link.target = '_blank'; // 在新标签页中打开
|
||||
link.download = 'file.docx'; // 设置下载文件的名称
|
||||
link.click();
|
||||
}
|
||||
if (title === '查看')
|
||||
{
|
||||
console.log(title);
|
||||
const link = document.createElement('a');
|
||||
const fileUrl = 'G:/南网数研院非结构化数据生成程序MMS_JSON修改记录.docx'; // 文件路径
|
||||
link.href = fileUrl;
|
||||
link.target = '_blank'; // 在新标签页中打开
|
||||
link.download = 'file.docx'; // 设置下载文件的名称
|
||||
link.click();
|
||||
}
|
||||
|
||||
if(title === '生成')
|
||||
{
|
||||
reportDialogVisible.value = true;
|
||||
}
|
||||
|
||||
if(title === '检测数据查询')
|
||||
{
|
||||
dataCheckDialogVisible.value = true;
|
||||
}
|
||||
if (title === '误差体系更换')
|
||||
{
|
||||
dataCheckChangeErrSysDialogVisible.value = true;
|
||||
}
|
||||
|
||||
else if (title === '误差体系编辑')
|
||||
console.log(title);
|
||||
|
||||
if (title === '归档')
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
|
||||
<div class = "test-dialog">
|
||||
<div class = "dialog">
|
||||
<div class="dialog-title">
|
||||
<el-progress
|
||||
style="width: 80%"
|
||||
@@ -28,8 +28,8 @@
|
||||
|
||||
</div>
|
||||
<div class="dialog-content">
|
||||
<el-table :data="errorData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border>
|
||||
<el-table-column prop="deviceName" label="检测项目" />
|
||||
<el-table :data="errorData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border v-on:cell-click="handleClick">
|
||||
<el-table-column fixed prop="deviceName" label="检测项目" />
|
||||
<el-table-column prop="updataTime" label="被检通道1" />
|
||||
<el-table-column prop="ErrorValue" label="被检通道2" />
|
||||
<el-table-column prop="Result" label="被检通道3" />
|
||||
@@ -45,11 +45,19 @@
|
||||
</el-collapse>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<resultPopup
|
||||
:visible="resultDialogVisible"
|
||||
@update:visible="resultDialogVisible = $event"
|
||||
></resultPopup>
|
||||
<dataCheckSingleChannelSingleTestPopup
|
||||
:visible="dataCheckSingleChannelSingleTestDialogVisable"
|
||||
@update:visible="dataCheckSingleChannelSingleTestDialogVisable = $event"
|
||||
></dataCheckSingleChannelSingleTestPopup>
|
||||
</template>
|
||||
<script lang="tsx" setup name="test">
|
||||
import { VideoPause,Refresh,Close } from '@element-plus/icons-vue'
|
||||
import resultPopup from './resultPopup.vue'
|
||||
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||
|
||||
const percentage = ref(0);
|
||||
const customColors = [
|
||||
@@ -57,7 +65,8 @@ const customColors = [
|
||||
];
|
||||
//暂停检测
|
||||
const isPause = ref<boolean>(false);
|
||||
|
||||
const resultDialogVisible = ref(false)
|
||||
const dataCheckSingleChannelSingleTestDialogVisable = ref(false);
|
||||
const handlePauseTest = () => {
|
||||
if (!isPause.value) {
|
||||
|
||||
@@ -68,9 +77,14 @@ const handlePauseTest = () => {
|
||||
};
|
||||
//完成检测
|
||||
const handleFinishTest = () => {
|
||||
resultDialogVisible.value = true
|
||||
ElMessage.success("完成检测");
|
||||
};
|
||||
|
||||
const handleClick = (row:any) => {
|
||||
console.log(111)
|
||||
dataCheckSingleChannelSingleTestDialogVisable.value = true;
|
||||
};
|
||||
|
||||
const errorData = ref([
|
||||
{
|
||||
@@ -143,7 +157,7 @@ watch(ts, function (newValue, oldValue) {
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.test-dialog{
|
||||
.dialog{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
import { useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
|
||||
import model from "./tabs/model.vue";
|
||||
import dashboard from "./tabs/dashboard.vue";
|
||||
import { onMounted } from "vue";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handelOpen(item.isActive)"
|
||||
@click="handelOpen(item)"
|
||||
:disabled="item.isActive == false"
|
||||
>进入检测</el-button
|
||||
>
|
||||
@@ -33,7 +33,9 @@
|
||||
import { useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useAuthStore } from "@/stores/modules/auth";
|
||||
import { useModeStore } from "@/stores/modules/mode"; // 引入模式 store
|
||||
const authStore = useAuthStore();
|
||||
const modeStore = useModeStore(); // 使用模式 store
|
||||
const activeIndex = ref("1-1");
|
||||
const router = useRouter();
|
||||
const modeList = [
|
||||
@@ -56,8 +58,10 @@ const modeList = [
|
||||
isActive: false,
|
||||
},
|
||||
];
|
||||
const handelOpen = async (isActive: any) => {
|
||||
const handelOpen = async (item: any) => {
|
||||
|
||||
await authStore.setShowMenu();
|
||||
modeStore.setCurrentMode(item.name); // 将模式名称存入 store
|
||||
return;
|
||||
if (isActive) {
|
||||
router.push({ path: "/static" });
|
||||
|
||||
@@ -3,25 +3,23 @@
|
||||
<ProTable
|
||||
ref='proTable'
|
||||
:columns='columns'
|
||||
:request-api="getTableList"
|
||||
:init-param="initParam"
|
||||
:data-callback="dataCallback"
|
||||
:request-api="getPqScriptList"
|
||||
>
|
||||
<!-- :data='testScriptData' 如果要显示静态数据,就切换该配置 -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
<el-button type='primary' :icon='CirclePlus' >新增</el-button>
|
||||
<el-button type='primary' :icon='Download' plain >导出数据</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'>
|
||||
<el-button type='primary' :icon='CirclePlus' @click="openDialog('add')">新增</el-button>
|
||||
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'
|
||||
@click='batchDelete(scope.selectedListIds)'>
|
||||
批量删除
|
||||
</el-button>
|
||||
</template>
|
||||
<!-- 表格操作 -->
|
||||
<template #operation='scope'>
|
||||
<el-button type='primary' link :icon='EditPen' >编辑</el-button>
|
||||
<el-button type='primary' link :icon='Delete' >删除</el-button>
|
||||
<el-button type='primary' :model-value="false" link :icon='Upload' >升级为模板</el-button>
|
||||
</template>
|
||||
<el-button type='primary' link :icon='EditPen' :model-value="false" @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||
<el-button type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||
<el-button type='primary' v-if="scope.row.type !== 1" link :icon='Share' @click='updateType(scope.row)'>升级</el-button>
|
||||
</template>
|
||||
|
||||
</ProTable>
|
||||
</div>
|
||||
@@ -35,11 +33,12 @@ import { useDownload } from '@/hooks/useDownload'
|
||||
import { useAuthButtons } from '@/hooks/useAuthButtons'
|
||||
import ProTable from '@/components/ProTable/index.vue'
|
||||
import type{ ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
|
||||
import { CirclePlus, Delete, EditPen, Share, Download, Upload, View, Refresh } from '@element-plus/icons-vue'
|
||||
import { CirclePlus, Delete, EditPen, Share } from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import {
|
||||
getTestScriptList,
|
||||
getPqScriptList,updatePqScript,deletePqScript,
|
||||
} from '@/api/device/testScript/index'
|
||||
import { reactive, ref } from 'vue'
|
||||
|
||||
const dictStore = useDictStore()
|
||||
|
||||
@@ -47,41 +46,17 @@ const dictStore = useDictStore()
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
|
||||
// 如果表格需要初始化请求参数,直接定义传给 ProTable (之后每次请求都会自动带上该参数,此参数更改之后也会一直带上,改变此参数会自动刷新表格数据)
|
||||
const initParam = reactive({ pattern: 1 })//表示当前用户选择的是模拟式测试,后期要读取pinia中的数据 TODO...
|
||||
|
||||
// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total 这些字段,可以在这里进行处理成这些字段
|
||||
// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
|
||||
const dataCallback = (data: any) => {
|
||||
return {
|
||||
list: data.list,
|
||||
total: data.total,
|
||||
pageNum: data.pageNum,
|
||||
pageSize: data.pageSize,
|
||||
}
|
||||
}
|
||||
|
||||
// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
|
||||
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList"
|
||||
const getTableList = (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params))
|
||||
newParams.createTime && (newParams.startTime = newParams.createTime[0])
|
||||
newParams.createTime && (newParams.endTime = newParams.createTime[1])
|
||||
delete newParams.createTime
|
||||
return getTestScriptList(newParams)
|
||||
}
|
||||
|
||||
// 页面按钮权限(按钮权限既可以使用 hooks,也可以直接使用 v-auth 指令,指令适合直接绑定在按钮上,hooks 适合根据按钮权限显示不同的内容)
|
||||
const { BUTTONS } = useAuthButtons()
|
||||
|
||||
const templateTypes = reactive([
|
||||
{ id: 0, name: '脚本' },
|
||||
{ id: 1, name: '模版' }
|
||||
]);
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<TestScript.TestScriptBO>[]>([
|
||||
const columns = reactive<ColumnProps<TestScript.ResTestScript>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||
{
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
search: { el: 'input' },
|
||||
minWidth: 350,
|
||||
},
|
||||
{
|
||||
@@ -97,21 +72,51 @@ const columns = reactive<ColumnProps<TestScript.TestScriptBO>[]>([
|
||||
{
|
||||
prop: 'valueType',
|
||||
label: '值类型',
|
||||
enum: dictStore.getDictData('testScriptValueType'),
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
enum: dictStore.getDictData('Script_Value_Type'),
|
||||
fieldNames: { label: 'name', value: 'id' },
|
||||
search: { el: 'select' },
|
||||
minWidth: 150,
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
label: '模板类型',
|
||||
enum: dictStore.getDictData('testScriptType'),
|
||||
fieldNames: { label: 'label', value: 'id' },
|
||||
search: { el: 'select' },
|
||||
minWidth: 150,
|
||||
render: scope => {
|
||||
return (
|
||||
<el-tag type={scope.row.type ? 'success' : 'primary'} > {scope.row.type ? '模版' : '脚本'} </el-tag>
|
||||
)
|
||||
},
|
||||
},
|
||||
{ prop: 'operation', label: '操作', fixed: 'right', width: 250 },
|
||||
])
|
||||
|
||||
|
||||
|
||||
// 打开 drawer(新增、编辑)
|
||||
const openDialog = (titleType: string, row: Partial<TestScript.ResTestScript> = {}) => {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 批量删除设备
|
||||
const batchDelete = async (id: string[]) => {
|
||||
await useHandleData(deletePqScript, id, '删除所选脚本')
|
||||
proTable.value?.clearSelection()
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
// 删除设备
|
||||
const handleDelete = async (params: TestScript.ResTestScript) => {
|
||||
await useHandleData(deletePqScript, [params.id], `删除【${params.name}】脚本`)
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
// 升级为模版
|
||||
const updateType = async (params: TestScript.ResTestScript) => {
|
||||
await useHandleData(updatePqScript, params, `升级【${params.name}】为模版`)
|
||||
proTable.value?.getTableList()
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
195
frontend/src/views/system/base/index.vue
Normal file
195
frontend/src/views/system/base/index.vue
Normal file
@@ -0,0 +1,195 @@
|
||||
<template>
|
||||
<div class='table-box' >
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane label="检测相关配置">
|
||||
<div class="form-grid">
|
||||
<el-divider >检测配置</el-divider>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label='一键检测方式' prop='autoGenerate' :label-width="125">
|
||||
<el-select v-model="TestConfigForm.autoGenerate" clearable placeholder="请选择一键检测方式" >
|
||||
<el-option label="只检测,报告后续手动生成" :value="0"></el-option>
|
||||
<el-option label="检测和生成报告同时进行" :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='复检最大次数' prop='maxTime' >
|
||||
<el-input-number v-model='TestConfigForm.maxTime' :min='1' :max='999' />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label='数据处理原则' prop='dataRule' :label-width="125">
|
||||
<el-select v-model="TestConfigForm.dataRule" clearable placeholder="请选择数据处理原则" >
|
||||
<el-option
|
||||
v-for="item in dictStore.getDictData('Data_Rule')"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-form :model="RegResForm" ref='dialogFormRef' :rules='rules' >
|
||||
<el-divider >有效数据配置</el-divider>
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label="录波数据有效组数" prop="waveRecord" :label-width="125">
|
||||
<el-input v-model.number='RegResForm.waveRecord' placeholder="/" disabled/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实时数据有效组数" prop="realTime" :label-width="125" >
|
||||
<el-input number v-model.number='RegResForm.realTime' placeholder="请输入实时数据有效组数"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="统计数据有效组数" prop="statistics" :label-width="125" >
|
||||
<el-input number v-model.number='RegResForm.statistics' placeholder="请输入统计数据有效组数"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="闪变数据有效组数" prop="flicker" :label-width="125" >
|
||||
<el-input number v-model.number='RegResForm.flicker' placeholder="请输入闪变数据有效组数"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm()">保存配置</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="日志配置">
|
||||
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="数据删除备份配置">
|
||||
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang='tsx''>
|
||||
import { type Dict } from '@/api/system/dictionary/interface'
|
||||
import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
|
||||
import PqPopup from '@/views/system/dictionary/dictPq/components/pqPopup.vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
import { computed, onMounted, reactive, Ref, ref } from 'vue'
|
||||
import {type Base } from '@/api/system/base/interface'
|
||||
import {type VersionRegister } from '@/api/system/versionRegister/interface'
|
||||
import {getTestConfig,updateTestConfig } from '@/api/system/base/index'
|
||||
import {getRegRes,updateRegRes } from '@/api/system/versionRegister/index'
|
||||
import { ElMessage, FormItemRule } from 'element-plus'
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
|
||||
const modeStore = useModeStore();
|
||||
const dictStore = useDictStore()
|
||||
const dialogFormRef = ref()
|
||||
const mode = ref()
|
||||
const TestConfigForm = ref<Base.ResTestConfig>({
|
||||
id: '',
|
||||
autoGenerate: 0,
|
||||
maxTime: 3,
|
||||
dataRule: '',
|
||||
state: 1, //状态
|
||||
})
|
||||
|
||||
const RegResForm = ref<VersionRegister.ResSys_Reg_Res>({
|
||||
id: '', //版本注册表Id
|
||||
type: '', //版本类型(模拟式、数字式、比对式)
|
||||
code: '', //注册码
|
||||
licenseKey: '', //密钥
|
||||
expireDate: '', //到期时间
|
||||
waveRecord: 0,
|
||||
realTime: 20,
|
||||
statistics: 5,
|
||||
flicker: 1,
|
||||
state: 1, //状态
|
||||
})
|
||||
|
||||
const RegResForm2 = ref<VersionRegister.Sys_Reg_Res>({
|
||||
id:'',
|
||||
waveRecord: 0,
|
||||
realTime: 20,
|
||||
statistics: 5,
|
||||
flicker: 1,
|
||||
})
|
||||
|
||||
|
||||
// 定义弹出组件元信息
|
||||
const rules = computed(() =>{
|
||||
const baseRules : Ref<Record<string, Array<FormItemRule>>> = ref({
|
||||
realTime :[
|
||||
{required:true,trigger:'blur',message:'实时数据有效组数必填!'},
|
||||
{ pattern: /^[0-9]\d*$/, message: '实时数据有效组数为含0的正整数', trigger: 'blur' }
|
||||
],
|
||||
statistics :[
|
||||
{required:true,trigger:'blur',message:'统计数据有效组数必填!'},
|
||||
{ pattern: /^[0-9]\d*$/, message: '统计数据有效组数为含0的正整数', trigger: 'blur' }
|
||||
],
|
||||
flicker :[
|
||||
{required:true,trigger:'blur',message:'闪变数据有效组数必填!'},
|
||||
{ pattern: /^[0-9]\d*$/, message: '闪变数据有效组数为含0的正整数', trigger: 'blur' }
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
if(mode.value == '比对式'){
|
||||
baseRules.value.waveRecord = [
|
||||
{required:true,trigger:'blur',message:'录波数据有效组数必填!'},
|
||||
{ pattern: /^[0-9]\d*$/, message: '录波数据有效组数为含0的正整数', trigger: 'blur' }
|
||||
];
|
||||
}
|
||||
|
||||
return baseRules;
|
||||
})
|
||||
|
||||
|
||||
const TestConfigList = ref<Base.ResTestConfig>()
|
||||
const RegResList = ref<VersionRegister.ResSys_Reg_Res>()
|
||||
// 初始化时获取
|
||||
onMounted(async () => {
|
||||
mode.value =modeStore.currentMode.replace('模块', '');//pinia中获取当前是那个模块进来的,临时处理去除模块两字
|
||||
const response = await getTestConfig()
|
||||
TestConfigForm.value = response.data as unknown as Base.ResTestConfig
|
||||
//console.log(mode)
|
||||
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== mode.value)?.id//获取数据字典中对应的id
|
||||
RegResForm.value.type = patternId || '';
|
||||
const response2 = await getRegRes(RegResForm.value)
|
||||
RegResForm.value = response2.data as unknown as VersionRegister.ResSys_Reg_Res
|
||||
|
||||
})
|
||||
|
||||
const submitForm = async () => {
|
||||
try {
|
||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
await updateTestConfig(TestConfigForm.value);
|
||||
|
||||
// 提取并传递 4 个参数
|
||||
const { id,waveRecord, realTime, statistics, flicker } = RegResForm.value
|
||||
RegResForm2.value = { id,waveRecord, realTime, statistics, flicker }
|
||||
|
||||
if(RegResForm.value.waveRecord == null){
|
||||
RegResForm2.value.waveRecord = -1
|
||||
}
|
||||
await updateRegRes(RegResForm2.value);
|
||||
|
||||
ElMessage.success({ message: `保存配置成功!` })
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
console.error('验证过程中出现错误', err)
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.dialog-footer {
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
54
frontend/src/views/system/versionRegister/index.vue
Normal file
54
frontend/src/views/system/versionRegister/index.vue
Normal file
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" title="程序激活" width="500px" draggable>
|
||||
<el-form :model="formContent">
|
||||
<el-form-item label="程序版本号" prop="pid" :label-width="100">
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="模拟式模块" prop="pid" :label-width="100">
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="数字式模块" prop="pid" :label-width="100">
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="比对式模块" prop="pid" :label-width="100">
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="序列号" prop="pid" :label-width="100">
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="注册码" prop="pid" :label-width="100">
|
||||
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">激活</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
const formContent = ref<Function.ResFunction>({
|
||||
id: '',//资源表Id
|
||||
pid:'',//节点(0为根节点)
|
||||
pids:'',//节点上层所有节点
|
||||
name: '',//名称
|
||||
code:'',//资源标识
|
||||
path:'',//路径
|
||||
component:'',
|
||||
icon:undefined as string | undefined, // 图标
|
||||
sort:100,//排序
|
||||
type:0,//资源类型0-菜单、1-按钮、2-公共资源、3-服务间调用资源
|
||||
remark: '',//权限资源描述
|
||||
state:1,//权限资源状态
|
||||
})
|
||||
const dialogVisible = ref(false);
|
||||
const openDialog = () => {
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
|
||||
defineExpose({ openDialog });
|
||||
</script>
|
||||
Reference in New Issue
Block a user