微调
This commit is contained in:
@@ -7,22 +7,22 @@ import http from '@/api'
|
||||
|
||||
//获取监测点
|
||||
export const getPqMonList = (params: Monitor.ReqPqMonParams) => {
|
||||
return http.post(`/pqMon/list`, params)
|
||||
//return http.post(`/pqMon/list`, params)
|
||||
}
|
||||
|
||||
//添加监测点
|
||||
export const addPqMon = (params: Monitor.ResPqMon) => {
|
||||
return http.post(`/pqMon/add`, params)
|
||||
//return http.post(`/pqMon/add`, params)
|
||||
}
|
||||
|
||||
//编辑监测点
|
||||
export const updatePqMon = (params: Monitor.ResPqMon) => {
|
||||
return http.post(`/pqMon/update`, params)
|
||||
//return http.post(`/pqMon/update`, params)
|
||||
}
|
||||
|
||||
//删除监测点
|
||||
export const deletePqMon = (params: string[]) => {
|
||||
return http.post(`/pqMon/delete`, params)
|
||||
//return http.post(`/pqMon/delete`, params)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,8 +38,27 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, computed } from "vue";
|
||||
import { ref, reactive, computed, onMounted, watch } from "vue";
|
||||
const title = ref("模拟式模块");
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
|
||||
const modeStore = useModeStore();
|
||||
watch(() => modeStore.currentMode, (newVal) => {
|
||||
//console.log('当前模式:', newVal);
|
||||
switch (newVal) {
|
||||
case '模拟式':
|
||||
title.value = '模拟式模块';
|
||||
break;
|
||||
case '数字式':
|
||||
title.value = '数字式模块';
|
||||
break;
|
||||
case '比对式':
|
||||
title.value = '比对式模块';
|
||||
break;
|
||||
default:
|
||||
title.value = '模拟式模块';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
@import "./index.scss";
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
<ProTable
|
||||
ref='proTable'
|
||||
:columns='columns'
|
||||
:request-api='getPqMonList'
|
||||
|
||||
>
|
||||
<!-- 表格 header 按钮 -->
|
||||
<template #tableHeader='scope'>
|
||||
@@ -253,6 +253,7 @@ const MonIsShow = ref(false)
|
||||
const DevIsShow = ref(false)
|
||||
const IsPasswordShow = ref(false)
|
||||
const dictStore = useDictStore()
|
||||
const mode = ref()
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
const disabledDate = (time: Date) => {
|
||||
@@ -265,7 +266,7 @@ const disabledDate = (time: Date) => {
|
||||
const formContent = ref<Device.ResPqDev>({
|
||||
id: '',
|
||||
name: '',
|
||||
pattern:'模拟式',
|
||||
pattern:mode.value,
|
||||
devType:'',
|
||||
devChns:1,
|
||||
devVolt:57.74,
|
||||
@@ -291,7 +292,7 @@ const disabledDate = (time: Date) => {
|
||||
formContent.value = {
|
||||
id: '',
|
||||
name: '',
|
||||
pattern:'模拟式',
|
||||
pattern:mode.value,
|
||||
devType:'',
|
||||
devChns:1,
|
||||
devVolt:57.74,
|
||||
@@ -390,18 +391,15 @@ const disabledDate = (time: Date) => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (sign: string, data: Device.ResPqDev) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
const open = (sign: string, data: Device.ResPqDev,currentMode: string) => {
|
||||
mode.value = currentMode
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
titleType.value = sign
|
||||
dialogVisible.value = true
|
||||
|
||||
const patternItem = dictStore.getDictData('Pattern').find(item => item.id === data.pattern)
|
||||
if( patternItem && patternItem.name ==='比对式'){
|
||||
if( currentMode ==='比对式'){
|
||||
DevIsShow.value = false
|
||||
MonIsShow.value = true
|
||||
}else{
|
||||
|
||||
@@ -42,7 +42,9 @@ import { useDictStore } from '@/stores/modules/dict'
|
||||
import { getPqDevList, deletePqDev, exportPqDev, downloadTemplate, importPqDev } from '@/api/device/device/index.ts'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
|
||||
const modeStore = useModeStore();
|
||||
const dictStore = useDictStore()
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
@@ -53,6 +55,8 @@ const getTableList = (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params))
|
||||
newParams.searchEndTime = endDate.value
|
||||
newParams.searchBeginTime = startDate.value
|
||||
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id
|
||||
newParams.pattern = patternId
|
||||
return getPqDevList(newParams)
|
||||
}
|
||||
|
||||
@@ -131,7 +135,7 @@ const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
|
||||
}
|
||||
// 打开 drawer(新增、编辑)
|
||||
const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
|
||||
devicePopup.value?.open(titleType, row)
|
||||
devicePopup.value?.open(titleType, row,modeStore.currentMode)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<el-dialog title="检测脚本信息" v-model='dialogVisible' @close="close" v-bind="dialogSmall">
|
||||
<div>
|
||||
<el-form :model="formContent" ref='dialogFormRef'>
|
||||
<el-tree
|
||||
:data="data"
|
||||
:props="defaultProps"
|
||||
node-key="id"
|
||||
show-checkbox
|
||||
:default-expanded-keys="[1]"
|
||||
>
|
||||
</el-tree>
|
||||
</el-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div >
|
||||
<el-button @click='close()'>取 消</el-button>
|
||||
<el-button type="primary" @click='save()'>保存脚本</el-button>
|
||||
<el-button type="primary" @click='save()'>脚本另存为</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
</template>
|
||||
<script setup lang='ts'>
|
||||
import { dialogSmall } from '@/utils/elementBind'
|
||||
import { ElMessage, type FormItemRule } from 'element-plus'
|
||||
import { computed, reactive, type Ref, ref } from 'vue'
|
||||
import { CirclePlus, Delete, EditPen } from '@element-plus/icons-vue'
|
||||
|
||||
const defaultProps = {
|
||||
children: 'children',
|
||||
label: 'label',
|
||||
}
|
||||
const data = [
|
||||
{
|
||||
id: 1,
|
||||
label: '比对模式检测脚本',
|
||||
children: [
|
||||
{
|
||||
id: 2,
|
||||
label: '频率',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
label: '电压',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
label: '电流',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
label: '电压不平衡',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
label: '电流不平衡',
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
label: '谐波电压',
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
label: '谐波电流',
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
label: '间谐波电压',
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
label: '间谐波电流',
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
label: '闪变',
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
|
||||
function useMetaInfo() {
|
||||
const dialogVisible = ref(false)
|
||||
const formContent = ref()
|
||||
return { dialogVisible, formContent }
|
||||
}
|
||||
|
||||
const { dialogVisible, formContent } = useMetaInfo()
|
||||
// 清空formContent
|
||||
const resetFormContent = () => {
|
||||
formContent.value = {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭弹窗
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
// 清空dialogForm中的值
|
||||
resetFormContent()
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
const save = () => {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (currentMode: string) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// 对外映射
|
||||
defineExpose({ open })
|
||||
const props = defineProps<{
|
||||
refreshTable: (() => Promise<void>) | undefined;
|
||||
}>()
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,75 @@
|
||||
<template>
|
||||
<el-dialog title="请确认检测脚本值类型" v-model='dialogVisible' @close="close" v-bind="dialogSmall">
|
||||
<div>
|
||||
<el-form :model="formContent" ref='dialogFormRef'>
|
||||
<el-form-item label="检测脚本值类型" >
|
||||
<el-select clearable placeholder="请选择类型检测脚本值类型" >
|
||||
<el-option label="相对值" :value="0"></el-option>
|
||||
<el-option label="绝对值" :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<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 { dialogSmall } from '@/utils/elementBind'
|
||||
import { ElMessage, type FormItemRule } from 'element-plus'
|
||||
import { computed, reactive, type Ref, ref } from 'vue'
|
||||
import { CirclePlus, Delete, EditPen } from '@element-plus/icons-vue'
|
||||
|
||||
|
||||
// 定义弹出组件元信息
|
||||
const dialogFormRef = ref()
|
||||
|
||||
function useMetaInfo() {
|
||||
const dialogVisible = ref(false)
|
||||
const formContent = ref()
|
||||
return { dialogVisible, formContent }
|
||||
}
|
||||
|
||||
const { dialogVisible, formContent } = useMetaInfo()
|
||||
// 清空formContent
|
||||
const resetFormContent = () => {
|
||||
formContent.value = {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 关闭弹窗
|
||||
const close = () => {
|
||||
dialogVisible.value = false
|
||||
// 清空dialogForm中的值
|
||||
resetFormContent()
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
|
||||
}
|
||||
|
||||
// 保存数据
|
||||
const save = () => {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = (currentMode: string) => {
|
||||
// 重置表单
|
||||
dialogFormRef.value?.resetFields()
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
// 对外映射
|
||||
defineExpose({ open })
|
||||
const props = defineProps<{
|
||||
refreshTable: (() => Promise<void>) | undefined;
|
||||
}>()
|
||||
|
||||
</script>
|
||||
@@ -3,7 +3,7 @@
|
||||
<ProTable
|
||||
ref='proTable'
|
||||
:columns='columns'
|
||||
:request-api="getPqScriptList"
|
||||
:request-api="getTableList"
|
||||
>
|
||||
<!-- :data='testScriptData' 如果要显示静态数据,就切换该配置 -->
|
||||
<!-- 表格 header 按钮 -->
|
||||
@@ -23,33 +23,40 @@
|
||||
|
||||
</ProTable>
|
||||
</div>
|
||||
<ComparisonPopup :refresh-table='proTable?.getTableList' ref='comparisonPopup' />
|
||||
<TestScriptPopup :refresh-table='proTable?.getTableList' ref='testScriptPopup' />
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang='tsx' name='useRole'>
|
||||
import { type TestScript } from '@/api/device/interface/testScript'
|
||||
import { useHandleData } from '@/hooks/useHandleData'
|
||||
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 } from '@element-plus/icons-vue'
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import ComparisonPopup from './components/comparisonPopup.vue'
|
||||
import TestScriptPopup from './components/testScriptPopup.vue'
|
||||
import {
|
||||
getPqScriptList,updatePqScript,deletePqScript,
|
||||
} from '@/api/device/testScript/index'
|
||||
import { reactive, ref } from 'vue'
|
||||
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
const comparisonPopup = ref()
|
||||
const testScriptPopup = ref()
|
||||
const modeStore = useModeStore();
|
||||
const dictStore = useDictStore()
|
||||
|
||||
const getTableList = (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params))
|
||||
const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id
|
||||
newParams.pattern = patternId
|
||||
return getPqScriptList(newParams)
|
||||
}
|
||||
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
|
||||
const templateTypes = reactive([
|
||||
{ id: 0, name: '脚本' },
|
||||
{ id: 1, name: '模版' }
|
||||
]);
|
||||
// 表格配置项
|
||||
const columns = reactive<ColumnProps<TestScript.ResTestScript>[]>([
|
||||
{ type: 'selection', fixed: 'left', width: 70 },
|
||||
@@ -58,6 +65,7 @@ const columns = reactive<ColumnProps<TestScript.ResTestScript>[]>([
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
minWidth: 350,
|
||||
search: {el:'input'}
|
||||
},
|
||||
{
|
||||
prop: 'standardName',
|
||||
@@ -94,7 +102,13 @@ const columns = reactive<ColumnProps<TestScript.ResTestScript>[]>([
|
||||
|
||||
// 打开 drawer(新增、编辑)
|
||||
const openDialog = (titleType: string, row: Partial<TestScript.ResTestScript> = {}) => {
|
||||
if(modeStore.currentMode == '比对式'){
|
||||
comparisonPopup.value?.open(titleType, row)
|
||||
}else{
|
||||
testScriptPopup.value?.open(titleType, row)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<el-row :gutter="24" >
|
||||
<el-col :span="8">
|
||||
<el-form-item label="录波数据有效组数" prop="waveRecord" :label-width="140">
|
||||
<el-input v-model.number='RegResForm.waveRecord' placeholder="/" :disabled="IsMode"/>
|
||||
<el-input v-model.number='RegResForm.waveRecord' :placeholder="placeholder" :disabled="IsMode"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -199,6 +199,7 @@
|
||||
const dialogFormRef = ref()
|
||||
const mode = ref()
|
||||
const IsMode = ref(false)
|
||||
const placeholder = ref()
|
||||
const TestConfigList = ref<Base.ResTestConfig>()
|
||||
const RegResList = ref<VersionRegister.ResSys_Reg_Res>()
|
||||
|
||||
@@ -214,8 +215,10 @@ onMounted(async () => {
|
||||
RegResForm.value = response2.data as unknown as VersionRegister.ResSys_Reg_Res
|
||||
//只有比对式有录波
|
||||
if(mode.value == '比对式'){
|
||||
placeholder.value = '请输入录波数据有效组数'
|
||||
IsMode.value = false
|
||||
}else{
|
||||
placeholder.value = '/'
|
||||
IsMode.value = true
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user