Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
This commit is contained in:
@@ -32,175 +32,200 @@ const errordata = ref<ErrorSystem.ErrorSystemList[]>([
|
|||||||
|
|
||||||
const errordetail = ref<ErrorSystem.Error_detail[]>([
|
const errordetail = ref<ErrorSystem.Error_detail[]>([
|
||||||
{
|
{
|
||||||
measured: '电压偏差',
|
col1: '电压偏差',
|
||||||
|
col2: '电压偏差',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: '10%~150%标称电压',
|
condition: '10%~150%标称电压',
|
||||||
maxErrorValue: '±0.1%Un'
|
maxErrorValue: '±0.1%Un'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '频率偏差',
|
col1:'频率偏差',
|
||||||
|
col2: '频率偏差',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'频率',
|
measurementType:'频率',
|
||||||
condition: '42.5~57.5 Hz',
|
condition: '42.5~57.5 Hz',
|
||||||
maxErrorValue: '±0.01Hz'
|
maxErrorValue: '±0.01Hz'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '三相不平衡度',
|
col1:'三相不平衡度',
|
||||||
|
col2: '三相不平衡度',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: '0.5%~5%',
|
condition: '0.5%~5%',
|
||||||
maxErrorValue: '±0.15%'
|
maxErrorValue: '±0.15%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '三相不平衡度',
|
col1:'三相不平衡度',
|
||||||
|
col2: '三相不平衡度',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: '5%(不包含)~ 40%',
|
condition: '5%(不包含)~ 40%',
|
||||||
maxErrorValue: '±0.3%'
|
maxErrorValue: '±0.3%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '三相不平衡度',
|
col1:'三相不平衡度',
|
||||||
|
col2: '三相不平衡度',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: '±1%'
|
maxErrorValue: '±1%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '电压波动/电压幅值',
|
col1:'电压波动',
|
||||||
|
col2: '电压幅值',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: '±0.2%Un'
|
maxErrorValue: '±0.2%Un'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '电压波动/持续时间',
|
col1:'电压波动',
|
||||||
|
col2: '持续时间',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'时间',
|
measurementType:'时间',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: '±1周波'
|
maxErrorValue: '±1周波'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '闪变',
|
col1:'闪变',
|
||||||
|
col2: '闪变',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'短时间闪变',
|
measurementType:'短时间闪变',
|
||||||
condition: 'Pst:0.2~10',
|
condition: 'Pst:0.2~10',
|
||||||
maxErrorValue: '±5%'
|
maxErrorValue: '±5%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '谐波和间谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: 'Uh≥1%Un',
|
condition: 'Uh≥1%Un',
|
||||||
maxErrorValue: '±5%Uh'
|
maxErrorValue: '±5%Uh'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '谐波和间谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: 'Uh<1%Un',
|
condition: 'Uh<1%Un',
|
||||||
maxErrorValue: '±0.05%Un'
|
maxErrorValue: '±0.05%Un'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '谐波和间谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: 'In≥3%In',
|
condition: 'In≥3%In',
|
||||||
maxErrorValue: '±5%Ih'
|
maxErrorValue: '±5%Ih'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '谐波和间谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: 'In<3%In',
|
condition: 'In<3%In',
|
||||||
maxErrorValue: '±0.15%In'
|
maxErrorValue: '±0.15%In'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '谐波和间谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'相角',
|
measurementType:'相角',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: 'h≤5,±1°*h'
|
maxErrorValue: 'h≤5,±1°*h'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '谐波和间谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'相角',
|
measurementType:'相角',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: 'h>5,±5°'
|
maxErrorValue: 'h>5,±5°'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '谐波和间谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'功率',
|
measurementType:'功率',
|
||||||
condition: 'Ph≥150W',
|
condition: 'Ph≥150W',
|
||||||
maxErrorValue: '±1%Ph'
|
maxErrorValue: '±1%Ph'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '谐波和间谐波',
|
col1:'谐波和间谐波',
|
||||||
|
col2: '谐波和间谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'功率',
|
measurementType:'功率',
|
||||||
condition: 'Ph<150W',
|
condition: 'Ph<150W',
|
||||||
maxErrorValue: '±1.5W'
|
maxErrorValue: '±1.5W'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '高频次谐波',
|
col1:'高频次谐波',
|
||||||
|
col2: '高频次谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: 'Uh≥1%Un',
|
condition: 'Uh≥1%Un',
|
||||||
maxErrorValue: '±5%Uh'
|
maxErrorValue: '±5%Uh'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '高频次谐波',
|
col1:'高频次谐波',
|
||||||
|
col2: '高频次谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: 'Uh<1%Un',
|
condition: 'Uh<1%Un',
|
||||||
maxErrorValue: '±0.05%Un'
|
maxErrorValue: '±0.05%Un'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '高频次谐波',
|
col1:'高频次谐波',
|
||||||
|
col2: '高频次谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: 'In≥3%In',
|
condition: 'In≥3%In',
|
||||||
maxErrorValue: '±5%Ih'
|
maxErrorValue: '±5%Ih'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '高频次谐波',
|
col1:'高频次谐波',
|
||||||
|
col2: '高频次谐波',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: 'In<3%In',
|
condition: 'In<3%In',
|
||||||
maxErrorValue: '±0.15%In'
|
maxErrorValue: '±0.15%In'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '功率',
|
col1:'功率',
|
||||||
|
col2: '功率',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'功率',
|
measurementType:'功率',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: '±0.5%'
|
maxErrorValue: '±0.5%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '电流',
|
col1:'电流',
|
||||||
|
col2: '电流',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: 'I≥0.05In',
|
condition: 'I≥0.05In',
|
||||||
maxErrorValue: '±0.5%'
|
maxErrorValue: '±0.5%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '电流',
|
col1:'电流',
|
||||||
|
col2: '电流',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电流',
|
measurementType:'电流',
|
||||||
condition: '0.01In≤I<0.05In',
|
condition: '0.01In≤I<0.05In',
|
||||||
maxErrorValue: '±1%'
|
maxErrorValue: '±1%'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '电压暂降、电压暂升和短时中断/电压幅值',
|
col1: '电压暂降、电压暂升和短时中断',
|
||||||
|
col2: '电压幅值',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'电压',
|
measurementType:'电压',
|
||||||
condition: '',
|
condition: '',
|
||||||
maxErrorValue: '±0.2%Un'
|
maxErrorValue: '±0.2%Un'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
measured: '电压暂降、电压暂升和短时中断/持续时间',
|
col1: '电压暂降、电压暂升和短时中断',
|
||||||
|
col2: '持续时间',
|
||||||
deviceLevel: 'A',
|
deviceLevel: 'A',
|
||||||
measurementType:'时间',
|
measurementType:'时间',
|
||||||
condition: '',
|
condition: '',
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export namespace TestSource {
|
|||||||
// 检测源接口
|
// 检测源接口
|
||||||
export interface ResTestSource {
|
export interface ResTestSource {
|
||||||
id: string; //检测源ID
|
id: string; //检测源ID
|
||||||
name: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成)
|
name?: string; //检测源名称(检测源类型 + 设备类型 + 数字自动生成)
|
||||||
pattern: string;//检测源模式(字典表Code字段,数字、模拟、比对)
|
pattern: string;//检测源模式(字典表Code字段,数字、模拟、比对)
|
||||||
type: string; //检测源类型(字典表Code字段,标准源、高精度设备)
|
type: string; //检测源类型(字典表Code字段,标准源、高精度设备)
|
||||||
devType: string;//检测源设备类型(字典表Code字段)
|
devType: string;//检测源设备类型(字典表Code字段)
|
||||||
|
|||||||
@@ -116,10 +116,10 @@ export namespace Dict {
|
|||||||
storeFlag?:string ;//sts、di的是否存储 1:存储 0:不存 储;
|
storeFlag?:string ;//sts、di的是否存储 1:存储 0:不存 储;
|
||||||
curSts?:number | null;//sts、do的当前值;
|
curSts?:number | null;//sts、do的当前值;
|
||||||
ctlSts?:number;//do的是否可远程控制 1:是 0:否;
|
ctlSts?:number;//do的是否可远程控制 1:是 0:否;
|
||||||
maxNum?:number ;//设置最大值
|
maxNum?:number | null;//设置最大值
|
||||||
minNum?: number;//设置最小值
|
minNum?: number| null;//设置最小值
|
||||||
setValue?:string | null;//参数为enum可设置的所有值序列
|
setValue?:string | null;//参数为enum可设置的所有值序列
|
||||||
strlen?:number ;//参数string可设置字符串的长度上 限
|
strlen?:number | null;//参数string可设置字符串的长度上 限
|
||||||
defaultValue?:string | null; //参数缺省值、告警code值
|
defaultValue?:string | null; //参数缺省值、告警code值
|
||||||
resourcesId?:string ; //报表数据来源(统计表表名)
|
resourcesId?:string ; //报表数据来源(统计表表名)
|
||||||
limitName?:string | null; //限值字段名称
|
limitName?:string | null; //限值字段名称
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 表格主体 -->
|
<!-- 表格主体 -->
|
||||||
<div class='card table-main'>
|
<div class='table-main' :class='{ card: showCard }' >
|
||||||
<!-- 表格头部 操作按钮 -->
|
<!-- 表格头部 操作按钮 -->
|
||||||
<div class='table-header'>
|
<div class='table-header'>
|
||||||
<div class='header-button-lf'>
|
<div class='header-button-lf'>
|
||||||
@@ -126,6 +126,7 @@ export interface ProTableProps {
|
|||||||
requestError?: (params: any) => void; // 表格 api 请求错误监听 ==> 非必传
|
requestError?: (params: any) => void; // 表格 api 请求错误监听 ==> 非必传
|
||||||
dataCallback?: (data: any) => any; // 返回数据的回调函数,可以对数据进行处理 ==> 非必传
|
dataCallback?: (data: any) => any; // 返回数据的回调函数,可以对数据进行处理 ==> 非必传
|
||||||
title?: string; // 表格标题 ==> 非必传
|
title?: string; // 表格标题 ==> 非必传
|
||||||
|
showCard?: boolean; // 下个是否需要卡片
|
||||||
pagination?: boolean; // 是否需要分页组件 ==> 非必传(默认为true)
|
pagination?: boolean; // 是否需要分页组件 ==> 非必传(默认为true)
|
||||||
initParam?: any; // 初始化请求参数 ==> 非必传(默认为{})
|
initParam?: any; // 初始化请求参数 ==> 非必传(默认为{})
|
||||||
border?: boolean; // 是否带有纵向边框 ==> 非必传(默认为true)
|
border?: boolean; // 是否带有纵向边框 ==> 非必传(默认为true)
|
||||||
@@ -141,6 +142,7 @@ const props = withDefaults(defineProps<ProTableProps>(), {
|
|||||||
pagination: true,
|
pagination: true,
|
||||||
initParam: {},
|
initParam: {},
|
||||||
border: true,
|
border: true,
|
||||||
|
showCard: true,
|
||||||
toolButton: true,
|
toolButton: true,
|
||||||
rowKey: 'id',
|
rowKey: 'id',
|
||||||
searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),
|
searchCol: () => ({ xs: 1, sm: 2, md: 2, lg: 3, xl: 4 }),
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<el-button :icon='customIcons[iconValue]' />
|
<el-button :icon='customIcons[iconValue]' />
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-dialog v-model='dialogVisible' :title='placeholder' top='50px' width='66%'>
|
<el-dialog v-model='dialogVisible' :title='placeholder' top='5%' width='30%' >
|
||||||
<el-input v-model='inputValue' placeholder='搜索图标' size='large' :prefix-icon='Icons.Search' />
|
<el-input v-model='inputValue' placeholder='搜索图标' size='large' :prefix-icon='Icons.Search' />
|
||||||
<el-scrollbar v-if='Object.keys(iconsList).length'>
|
<el-scrollbar v-if='Object.keys(iconsList).length'>
|
||||||
<div class='icon-list'>
|
<div class='icon-list'>
|
||||||
|
|||||||
@@ -18,13 +18,13 @@
|
|||||||
<!-- </el-button> -->
|
<!-- </el-button> -->
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item @click="title = '模拟式模块'"
|
<el-dropdown-item @click="handelOpen('模拟式')"
|
||||||
>模拟式模块</el-dropdown-item
|
>模拟式模块</el-dropdown-item
|
||||||
>
|
>
|
||||||
<el-dropdown-item @click="title = '数字式模块'"
|
<el-dropdown-item @click="handelOpen('数字式')"
|
||||||
>数字式模块</el-dropdown-item
|
>数字式模块</el-dropdown-item
|
||||||
>
|
>
|
||||||
<el-dropdown-item @click="title = '比对式模块'"
|
<el-dropdown-item @click="handelOpen('比对式')"
|
||||||
>比对式模块</el-dropdown-item
|
>比对式模块</el-dropdown-item
|
||||||
>
|
>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@@ -39,13 +39,16 @@
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, computed, onMounted, watch } from "vue";
|
import { ref, reactive, computed, onMounted, watch } from "vue";
|
||||||
const title = ref("模拟式模块");
|
import { useAuthStore } from "@/stores/modules/auth";
|
||||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
const title = ref("模拟式模块");
|
||||||
|
const router = useRouter();
|
||||||
|
const authStore = useAuthStore();
|
||||||
const modeStore = useModeStore();
|
const modeStore = useModeStore();
|
||||||
watch(() => modeStore.currentMode, (newVal) => {
|
|
||||||
//console.log('当前模式:', newVal);
|
onMounted(() => {
|
||||||
switch (newVal) {
|
switch (modeStore.currentMode) {
|
||||||
case '模拟式':
|
case '模拟式':
|
||||||
title.value = '模拟式模块';
|
title.value = '模拟式模块';
|
||||||
break;
|
break;
|
||||||
@@ -59,6 +62,13 @@ watch(() => modeStore.currentMode, (newVal) => {
|
|||||||
title.value = '模拟式模块';
|
title.value = '模拟式模块';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const handelOpen = async (item: string) => {
|
||||||
|
await authStore.setShowMenu();
|
||||||
|
modeStore.setCurrentMode(item); // 将模式code存入 store
|
||||||
|
router.push({ path: "/home/index" });
|
||||||
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@import "./index.scss";
|
@import "./index.scss";
|
||||||
|
|||||||
@@ -500,6 +500,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-message-box__headerbtn{
|
||||||
|
top: 5px;
|
||||||
|
}
|
||||||
|
.el-message-box__close{
|
||||||
|
svg{
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
:hover{
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
}
|
||||||
.el-message-box__content{
|
.el-message-box__content{
|
||||||
padding: 10px ;
|
padding: 10px ;
|
||||||
border-bottom: 1px solid #cccccc;
|
border-bottom: 1px solid #cccccc;
|
||||||
@@ -508,3 +520,59 @@
|
|||||||
|
|
||||||
padding: 10px;}
|
padding: 10px;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-one {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
.el-form-item {
|
||||||
|
display: flex;
|
||||||
|
width: 98%;
|
||||||
|
margin-bottom: 15px !important;
|
||||||
|
.el-form-item__content {
|
||||||
|
flex: 1;
|
||||||
|
.el-select,
|
||||||
|
.el-cascader,
|
||||||
|
.el-input__inner,
|
||||||
|
.el-date-editor {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.form-two {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
.el-form-item {
|
||||||
|
display: flex;
|
||||||
|
width: 48%;
|
||||||
|
.el-form-item__content {
|
||||||
|
flex: 1;
|
||||||
|
.el-select,
|
||||||
|
.el-cascader,
|
||||||
|
.el-input__inner,
|
||||||
|
.el-date-editor {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.form-three {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
// justify-content: space-between;
|
||||||
|
.el-form-item {
|
||||||
|
display: flex;
|
||||||
|
width: 32.3%;
|
||||||
|
.el-form-item__content {
|
||||||
|
flex: 1;
|
||||||
|
.el-select,
|
||||||
|
.el-cascader,
|
||||||
|
.el-input__inner,
|
||||||
|
.el-date-editor {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="dialogTitle" :model-value="dialogVisible" @close="close" v-bind="dialogMiddle">
|
<el-dialog :title="dialogTitle" :model-value="dialogVisible" @close="close" v-bind="dialogMiddle">
|
||||||
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' >
|
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' class="form-two">
|
||||||
<el-form-item label="上级菜单" prop="pid" :label-width="100">
|
<el-form-item label="上级菜单" prop="pid" :label-width="100">
|
||||||
<el-tree-select
|
<el-tree-select
|
||||||
v-model="displayPid"
|
v-model="displayPid"
|
||||||
|
|||||||
@@ -8,31 +8,34 @@
|
|||||||
<!-- <div>系数校准表</div> -->
|
<!-- <div>系数校准表</div> -->
|
||||||
<div>当前源输出为:Ua=Ub=Uc=57.74V Ia=Ib=Ic=1A; 电压误差为:±0.1Un%; 电流误差为:±0.5%</div>
|
<div>当前源输出为:Ua=Ub=Uc=57.74V Ia=Ib=Ic=1A; 电压误差为:±0.1Un%; 电流误差为:±0.5%</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">通道系数已校准3台/共3台</el-button>
|
<span style=" font-size: 18px;font-weight: 600;">
|
||||||
<el-button type="primary" :disabled="true" v-if="activeIndex === activeTotalNum">通道系数已校准3台/共3台</el-button>
|
设备已合格 <span style="color: #67C23A">{{ qualified }}</span> 台/共 <span style="color: green">{{ total }}</span>
|
||||||
|
台
|
||||||
|
</span>
|
||||||
|
<!-- <el-button type="primary" loading
|
||||||
|
v-if="activeIndex > 0 && activeIndex < activeTotalNum">通道系数已校准3台/共3台</el-button>
|
||||||
|
<el-button type="primary" :disabled="true" v-if="activeIndex === activeTotalNum">通道系数已校准3台/共3台</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-content">
|
<div class="right-content">
|
||||||
<el-tabs type="border-card">
|
<el-tabs type="border-card">
|
||||||
<el-empty description="暂无数据,等待检测开始" v-if="activeIndex === 0" />
|
<el-empty description="暂无数据,等待检测开始" v-if="activeIndex === 0" />
|
||||||
<el-tab-pane label="被检设备1" v-if="activeIndex > 0">
|
<el-tab-pane label="被检设备1" v-if="activeIndex > 0">
|
||||||
<channelsTestTable
|
<channelsTestTable :tableData="tableData1"></channelsTestTable>
|
||||||
:tableData="tableData1"
|
|
||||||
></channelsTestTable>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="被检设备2" v-if="activeIndex > 1">
|
<el-tab-pane label="被检设备2" v-if="activeIndex > 1">
|
||||||
<template #label>
|
<template #label>
|
||||||
<span class="custom-tabs-label">
|
<span class="custom-tabs-label">
|
||||||
<span>被检设备2</span>
|
<span>被检设备2</span>
|
||||||
<el-icon><Failed /></el-icon>
|
<el-icon>
|
||||||
|
<Failed />
|
||||||
|
</el-icon>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<channelsTestTable
|
<channelsTestTable :tableData="tableData2"></channelsTestTable>
|
||||||
:tableData="tableData2"></channelsTestTable>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="被检设备3" v-if="activeIndex > 2">
|
<el-tab-pane label="被检设备3" v-if="activeIndex > 2">
|
||||||
<channelsTestTable
|
<channelsTestTable :tableData="tableData3"></channelsTestTable>
|
||||||
:tableData="tableData3"></channelsTestTable>
|
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
|
|
||||||
@@ -48,7 +51,8 @@ import { SuccessFilled,Failed } from '@element-plus/icons-vue'
|
|||||||
|
|
||||||
const activeIndex = ref(0)
|
const activeIndex = ref(0)
|
||||||
const activeTotalNum = ref(3)
|
const activeTotalNum = ref(3)
|
||||||
|
const qualified = ref(0)
|
||||||
|
const total = ref(0)
|
||||||
|
|
||||||
const activities = [
|
const activities = [
|
||||||
{
|
{
|
||||||
@@ -254,24 +258,24 @@ const ts = ref('');
|
|||||||
//监听goods_sn的变化
|
//监听goods_sn的变化
|
||||||
watch(testStatus, function (newValue, oldValue) {
|
watch(testStatus, function (newValue, oldValue) {
|
||||||
ts.value = props.testStatus;
|
ts.value = props.testStatus;
|
||||||
if(ts.value==='start')
|
if (ts.value === 'start') {
|
||||||
{
|
|
||||||
ts.value = 'process'
|
ts.value = 'process'
|
||||||
|
|
||||||
let timer = setInterval(() => {
|
let timer = setInterval(() => {
|
||||||
if(activeIndex.value < activeTotalNum.value)
|
if (activeIndex.value < activeTotalNum.value) {
|
||||||
activeIndex.value++
|
activeIndex.value++
|
||||||
else if(activeIndex.value === activeTotalNum.value)
|
qualified.value = activeIndex.value
|
||||||
{
|
}
|
||||||
|
else if (activeIndex.value === activeTotalNum.value) {
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
ts.value = 'success'
|
ts.value = 'success'
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
ts.value = 'success'
|
ts.value = 'success'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
total.value = activeTotalNum.value
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -341,10 +345,12 @@ emit('update:testStatus',ts.value)
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.right-title {
|
.right-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row; /* 横向排列 */
|
flex-direction: row;
|
||||||
|
/* 横向排列 */
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right-content {
|
.right-content {
|
||||||
/* max-height: 400px; */
|
/* max-height: 400px; */
|
||||||
}
|
}
|
||||||
@@ -352,14 +358,20 @@ emit('update:testStatus',ts.value)
|
|||||||
.custom-tabs-label .el-icon {
|
.custom-tabs-label .el-icon {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-tabs-label span {
|
.custom-tabs-label span {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-content {
|
.dialog-content {
|
||||||
height: 472px;
|
height: 472px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-tabs--border-card {
|
.el-tabs--border-card {
|
||||||
height: 435px;
|
height: 425px;
|
||||||
|
}
|
||||||
|
.el-icon svg {
|
||||||
|
color: #ff7171;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div class="table-container">
|
<div class="table-container table-main">
|
||||||
<el-table :data="tableData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" >
|
<el-table :data="tableData" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" >
|
||||||
|
|
||||||
<el-table-column prop="id" label="序号" width="70" />
|
<el-table-column prop="id" label="序号" width="70" />
|
||||||
<el-table-column prop="updateTime" label="上送时刻" />
|
<el-table-column prop="updateTime" label="上送时刻" width="180"/>
|
||||||
<el-table-column prop="deviceName" label="设备名称" />
|
<!-- <el-table-column prop="deviceName" label="设备名称" /> -->
|
||||||
<el-table-column prop="MonitorIdx" label="监测点序号" />
|
<el-table-column prop="MonitorIdx" label="监测点序号" />
|
||||||
|
|
||||||
<el-table-column label="电压通道" >
|
<el-table-column label="电压通道" >
|
||||||
|
|||||||
@@ -2,67 +2,58 @@
|
|||||||
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" draggable height="650px" width="1165px">
|
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" draggable height="650px" width="1165px">
|
||||||
<div class="change-errsys-dialog">
|
<div class="change-errsys-dialog">
|
||||||
<div class="change-errsys-title">
|
<div class="change-errsys-title">
|
||||||
<el-form :model='formContent'>
|
<el-form :model='formContent' label-width="auto" class="form-three">
|
||||||
<el-row :gutter="24" >
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="设备名称:">
|
<el-form-item label="设备名称:">
|
||||||
<el-input v-model='deviceName' :disabled="true" />
|
<el-input v-model='deviceName' :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="检测脚本:">
|
<el-form-item label="检测脚本:">
|
||||||
<el-input v-model='testScriptName' :disabled="true" />
|
<el-input v-model='testScriptName' :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="数据处理原则:">
|
<el-form-item label="数据处理原则:">
|
||||||
<el-input v-model='dataRule' :disabled="true" />
|
<el-input v-model='dataRule' :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="24" >
|
<el-form-item label="误差体系:">
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="误差体系">
|
|
||||||
<el-select v-model="error_Sys_Id" autocomplete="off">
|
<el-select v-model="error_Sys_Id" autocomplete="off">
|
||||||
<el-option
|
<el-option v-for="plan in testErrSystDataList" :key="plan.id" :label="plan.label" :value="plan.id"
|
||||||
v-for="plan in testErrSystDataList"
|
:disabled="plan.label === errorSysName">
|
||||||
:key="plan.id"
|
|
||||||
:label="plan.label"
|
|
||||||
:value="plan.id"
|
|
||||||
:disabled = "plan.label === errorSysName"
|
|
||||||
>
|
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item >
|
<el-form-item label=" ">
|
||||||
<el-button type="primary" :icon="VideoPlay" @click="dealData">数据计算</el-button>
|
<el-button type="primary" :icon="VideoPlay" @click="dealData">数据计算</el-button>
|
||||||
<el-button type="primary" :icon="Postcard" :disabled="reportDisabled" @click="openReportDlg">报告生成</el-button>
|
<el-button type="primary" :icon="Postcard" :disabled="reportDisabled"
|
||||||
|
@click="openReportDlg">报告生成</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="change-errsys-content">
|
<div class="change-errsys-content">
|
||||||
<div class="tabs-title">
|
<div class="tabs-title">
|
||||||
<el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">合格92项/共103项</el-button>
|
<!-- <el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">合格92项/共103项</el-button>
|
||||||
<el-button type="primary" v-if="activeIndex >= activeTotalNum" disabled>合格92项/共103项</el-button>
|
<el-button type="primary" v-if="activeIndex >= activeTotalNum" disabled>合格92项/共103项</el-button> -->
|
||||||
|
<span style=" font-size: 18px;font-weight: 600;">
|
||||||
|
设备已合格 <span style="color: #67C23A">{{ qualified }}</span> 台/共 <span style="color: green">{{ 103 }}</span>
|
||||||
|
台
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="dialog-content">
|
<div class="dialog-content">
|
||||||
<el-table :data="tableData" row-key="id" height="545px" :header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%" border>
|
<el-table :data="tableData" row-key="id" height="450px"
|
||||||
|
:header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' }" style="width: 100%"
|
||||||
|
border>
|
||||||
<el-table-column fixed prop="scriptItemName" label="检测项目" width="210px" />
|
<el-table-column fixed prop="scriptItemName" label="检测项目" width="210px" />
|
||||||
|
|
||||||
<el-table-column label="被检通道1" align="center">
|
<el-table-column label="被检通道1" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
|
||||||
<el-tooltip :content="scope.row.resultType1 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
<el-tooltip :content="scope.row.resultType1 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||||
<el-button
|
<el-button :disabled="scope.row.resultType1 == 'info'" :type="scope.row.resultType1" size="small"
|
||||||
:disabled = "scope.row.resultType1=='info'"
|
@click="handleClick(scope.row)">
|
||||||
:type="scope.row.resultType1"
|
|
||||||
size="small"
|
|
||||||
@click="handleClick(scope.row)"
|
|
||||||
>
|
|
||||||
{{ scope.row.resultValue1 }}
|
{{ scope.row.resultValue1 }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -73,12 +64,8 @@
|
|||||||
<el-table-column label="被检通道2" align="center">
|
<el-table-column label="被检通道2" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip :content="scope.row.resultType2 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
<el-tooltip :content="scope.row.resultType2 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||||
<el-button
|
<el-button :disabled="scope.row.resultType2 == 'info'" :type="scope.row.resultType2" size="small"
|
||||||
:disabled = "scope.row.resultType2=='info'"
|
@click="handleClick(scope.row)">
|
||||||
:type="scope.row.resultType2"
|
|
||||||
size="small"
|
|
||||||
@click="handleClick(scope.row)"
|
|
||||||
>
|
|
||||||
{{ scope.row.resultValue2 }}
|
{{ scope.row.resultValue2 }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -88,12 +75,8 @@
|
|||||||
<el-table-column label="被检通道3" align="center">
|
<el-table-column label="被检通道3" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip :content="scope.row.resultType3 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
<el-tooltip :content="scope.row.resultType3 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||||
<el-button
|
<el-button :disabled="scope.row.resultType3 == 'info'" :type="scope.row.resultType3" size="small"
|
||||||
:disabled = "scope.row.resultType3=='info'"
|
@click="handleClick(scope.row)">
|
||||||
:type="scope.row.resultType3"
|
|
||||||
size="small"
|
|
||||||
@click="handleClick(scope.row)"
|
|
||||||
>
|
|
||||||
{{ scope.row.resultValue3 }}
|
{{ scope.row.resultValue3 }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -103,12 +86,8 @@
|
|||||||
<el-table-column label="被检通道4" align="center">
|
<el-table-column label="被检通道4" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip :content="scope.row.resultType4 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
<el-tooltip :content="scope.row.resultType4 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||||
<el-button
|
<el-button :disabled="scope.row.resultType4 == 'info'" :type="scope.row.resultType4" size="small"
|
||||||
:disabled = "scope.row.resultType4=='info'"
|
@click="handleClick(scope.row)">
|
||||||
:type="scope.row.resultType4"
|
|
||||||
size="small"
|
|
||||||
@click="handleClick(scope.row)"
|
|
||||||
>
|
|
||||||
{{ scope.row.resultValue4 }}
|
{{ scope.row.resultValue4 }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -118,12 +97,8 @@
|
|||||||
<el-table-column p label="被检通道5" align="center">
|
<el-table-column p label="被检通道5" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip :content="scope.row.resultType5 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
<el-tooltip :content="scope.row.resultType5 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||||
<el-button
|
<el-button :disabled="scope.row.resultType5 == 'info'" :type="scope.row.resultType5" size="small"
|
||||||
:disabled = "scope.row.resultType5=='info'"
|
@click="handleClick(scope.row)">
|
||||||
:type="scope.row.resultType5"
|
|
||||||
size="small"
|
|
||||||
@click="handleClick(scope.row)"
|
|
||||||
>
|
|
||||||
{{ scope.row.resultValue5 }}
|
{{ scope.row.resultValue5 }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -133,13 +108,8 @@
|
|||||||
<el-table-column label="被检通道6" align="center">
|
<el-table-column label="被检通道6" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip :content="scope.row.resultType6 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
<el-tooltip :content="scope.row.resultType6 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||||
<el-button
|
<el-button tip :disabled="scope.row.resultType6 == 'info'" :type="scope.row.resultType6" size="small"
|
||||||
tip
|
@click="handleClick(scope.row)">
|
||||||
:disabled = "scope.row.resultType6=='info'"
|
|
||||||
:type="scope.row.resultType6"
|
|
||||||
size="small"
|
|
||||||
@click="handleClick(scope.row)"
|
|
||||||
>
|
|
||||||
{{ scope.row.resultValue6 }}
|
{{ scope.row.resultValue6 }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -149,12 +119,8 @@
|
|||||||
<el-table-column label="被检通道7" align="center">
|
<el-table-column label="被检通道7" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip :content="scope.row.resultType7 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
<el-tooltip :content="scope.row.resultType7 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||||
<el-button
|
<el-button :disabled="scope.row.resultType7 == 'info'" :type="scope.row.resultType7" size="small"
|
||||||
:disabled = "scope.row.resultType7=='info'"
|
@click="handleClick(scope.row)">
|
||||||
:type="scope.row.resultType7"
|
|
||||||
size="small"
|
|
||||||
@click="handleClick(scope.row)"
|
|
||||||
>
|
|
||||||
{{ scope.row.resultValue7 }}
|
{{ scope.row.resultValue7 }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -164,12 +130,8 @@
|
|||||||
<el-table-column label="被检通道8" align="center">
|
<el-table-column label="被检通道8" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-tooltip :content="scope.row.resultType8 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
<el-tooltip :content="scope.row.resultType8 === 'info' ? '暂无数据' : '点击查看详情'" placement="top">
|
||||||
<el-button
|
<el-button :disabled="scope.row.resultType8 == 'info'" :type="scope.row.resultType8" size="small"
|
||||||
:disabled = "scope.row.resultType8=='info'"
|
@click="handleClick(scope.row)">
|
||||||
:type="scope.row.resultType8"
|
|
||||||
size="small"
|
|
||||||
@click="handleClick(scope.row)"
|
|
||||||
>
|
|
||||||
{{ scope.row.resultValue8 }}
|
{{ scope.row.resultValue8 }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
@@ -193,10 +155,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ReportPopup :visible="reportDialogVisible" @update:visible="reportDialogVisible = $event"></ReportPopup>
|
<ReportPopup :visible="reportDialogVisible" @update:visible="reportDialogVisible = $event"></ReportPopup>
|
||||||
<dataCheckSingleChannelSingleTestPopup
|
<dataCheckSingleChannelSingleTestPopup :visible="dataCheckSingleChannelSingleTestDialogVisable"
|
||||||
:visible="dataCheckSingleChannelSingleTestDialogVisable"
|
@update:visible="dataCheckSingleChannelSingleTestDialogVisable = $event"></dataCheckSingleChannelSingleTestPopup>
|
||||||
@update:visible="dataCheckSingleChannelSingleTestDialogVisable = $event"
|
|
||||||
></dataCheckSingleChannelSingleTestPopup>
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
@@ -223,7 +183,7 @@ import ReportPopup from './reportPopup.vue'
|
|||||||
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
import dataCheckSingleChannelSingleTestPopup from './dataCheckSingleChannelSingleTestPopup.vue'
|
||||||
|
|
||||||
|
|
||||||
|
const qualified = ref(0)
|
||||||
const reportDisabled = ref(true)
|
const reportDisabled = ref(true)
|
||||||
const reportDialogVisible = ref(false)
|
const reportDialogVisible = ref(false)
|
||||||
const deviceName = ref('被检设备1');
|
const deviceName = ref('被检设备1');
|
||||||
@@ -238,8 +198,7 @@ const reportDisabled = ref(true)
|
|||||||
label: "name",
|
label: "name",
|
||||||
pid: "pid",
|
pid: "pid",
|
||||||
};
|
};
|
||||||
const judge = (label:string) =>
|
const judge = (label: string) => {
|
||||||
{
|
|
||||||
console.log(label, errorSysName.value)
|
console.log(label, errorSysName.value)
|
||||||
if (label === errorSysName.value)
|
if (label === errorSysName.value)
|
||||||
return true
|
return true
|
||||||
@@ -391,8 +350,7 @@ function getRandomInt(max: number): number {
|
|||||||
const updateLog = () => {
|
const updateLog = () => {
|
||||||
const currentTime = ref(new Date().toLocaleString());
|
const currentTime = ref(new Date().toLocaleString());
|
||||||
|
|
||||||
switch(activeIndex.value)
|
switch (activeIndex.value) {
|
||||||
{
|
|
||||||
case 1:
|
case 1:
|
||||||
testLogList.value.length = 0; // 清空数组
|
testLogList.value.length = 0; // 清空数组
|
||||||
testLogList.value.push({
|
testLogList.value.push({
|
||||||
@@ -476,20 +434,16 @@ const dataCheckSingleChannelSingleTestDialogVisable = ref(false);
|
|||||||
function traverseTableData(data: any[], id: string): void {
|
function traverseTableData(data: any[], id: string): void {
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
// 处理当前节点的数据
|
// 处理当前节点的数据
|
||||||
if(item.id === id)
|
if (item.id === id) {
|
||||||
{
|
for (let i = 1; i <= 8; i++) {
|
||||||
for(let i = 1;i<=8;i++)
|
|
||||||
{
|
|
||||||
let field1 = "resultType" + i
|
let field1 = "resultType" + i
|
||||||
let field2 = "resultValue" + i
|
let field2 = "resultValue" + i
|
||||||
|
|
||||||
if(getRandomInt(10)>8 && activeIndex.value>2)
|
if (getRandomInt(10) > 8 && activeIndex.value > 2) {
|
||||||
{
|
|
||||||
item[field1] = "danger";
|
item[field1] = "danger";
|
||||||
item[field2] = "×";
|
item[field2] = "×";
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
item[field1] = "success";
|
item[field1] = "success";
|
||||||
item[field2] = "√";
|
item[field2] = "√";
|
||||||
}
|
}
|
||||||
@@ -1832,12 +1786,10 @@ const startTimer = () => {
|
|||||||
timer.value = setInterval(() => {
|
timer.value = setInterval(() => {
|
||||||
|
|
||||||
console.log(activeIndex.value, 111)
|
console.log(activeIndex.value, 111)
|
||||||
if(activeIndex.value <= activeTotalNum.value)
|
if (activeIndex.value <= activeTotalNum.value) {
|
||||||
{
|
|
||||||
activeIndex.value++;
|
activeIndex.value++;
|
||||||
|
|
||||||
switch(activeIndex.value)
|
switch (activeIndex.value) {
|
||||||
{
|
|
||||||
case 1:
|
case 1:
|
||||||
updateTableData("1-1-1")
|
updateTableData("1-1-1")
|
||||||
updateTableData("1-1-2")
|
updateTableData("1-1-2")
|
||||||
@@ -1890,14 +1842,13 @@ const startTimer = () => {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
console.log(activeIndex.value, 222)
|
console.log(activeIndex.value, 222)
|
||||||
clearInterval(timer.value)
|
clearInterval(timer.value)
|
||||||
reportDisabled.value = false;
|
reportDisabled.value = false;
|
||||||
console.log(activeIndex.value, 333)
|
console.log(activeIndex.value, 333)
|
||||||
}
|
}
|
||||||
|
qualified.value = 92
|
||||||
}, 100);
|
}, 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1917,7 +1868,6 @@ const resumeTimer = () => {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
.change-errsys-dialog {
|
.change-errsys-dialog {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -1939,5 +1889,14 @@ const resumeTimer = () => {
|
|||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-button--small) {
|
||||||
|
height: 20px !important;
|
||||||
|
width: 20px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.el-table--default td) {
|
||||||
|
padding: 5px 0 !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -2,30 +2,20 @@
|
|||||||
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" width="1065px" draggable>
|
<el-dialog title="数据查询" :model-value='visible' @close="handleCancel" width="1065px" draggable>
|
||||||
<div class="data-check-dialog">
|
<div class="data-check-dialog">
|
||||||
<div class="data-check-title">
|
<div class="data-check-title">
|
||||||
<el-form :model='formContent'>
|
<el-form :model='formContent' label-width="auto" class="form-three ">
|
||||||
<el-row :gutter="24" >
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="检测脚本:" >
|
<el-form-item label="检测脚本:" >
|
||||||
<el-input v-model='testScriptName' :disabled="true"/>
|
<el-input v-model='testScriptName' :disabled="true"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="误差体系:" >
|
<el-form-item label="误差体系:" >
|
||||||
<el-input v-model='errorSysName' :disabled="true"/>
|
<el-input v-model='errorSysName' :disabled="true"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="数据处理原则:" >
|
<el-form-item label="数据处理原则:" >
|
||||||
<el-input v-model='dataRule' :disabled="true"/>
|
<el-input v-model='dataRule' :disabled="true"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="24" >
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label="设备名称:" >
|
<el-form-item label="设备名称:" >
|
||||||
<el-input v-model='deviceName' :disabled="true"/>
|
<el-input v-model='deviceName' :disabled="true"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
<!-- <el-col :span="8">
|
<!-- <el-col :span="8">
|
||||||
<el-form-item label='复检次数:'>
|
<el-form-item label='复检次数:'>
|
||||||
<el-select v-model="reCheckIdx">
|
<el-select v-model="reCheckIdx">
|
||||||
@@ -38,7 +28,6 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item label='通道号:'>
|
<el-form-item label='通道号:'>
|
||||||
<el-select v-model="monitorIdx">
|
<el-select v-model="monitorIdx">
|
||||||
<el-option
|
<el-option
|
||||||
@@ -49,8 +38,6 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div class="data-check-content">
|
<div class="data-check-content">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div class="table-container">
|
<div class="table-container table-main">
|
||||||
<el-table :data="tableData" stripe :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" height="310px" style="width: 100%" >
|
<el-table :data="tableData" stripe border :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" height="310px" style="width: 100%" >
|
||||||
<el-table-column prop="id" label="序号" width="70" />
|
<el-table-column prop="id" label="序号" width="70" />
|
||||||
<el-table-column prop="updateTime" label="数据时间" />
|
<el-table-column prop="updateTime" label="数据时间" />
|
||||||
<el-table-column prop="L1" label="L1(V)" />
|
<el-table-column prop="L1" label="L1(V)" />
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
|
|
||||||
<div class="table-container">
|
<div class="table-container table-main">
|
||||||
|
|
||||||
<el-table :data="tableData" max-height="300" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" >
|
<el-table :data="tableData" height="310px" :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" >
|
||||||
|
|
||||||
<el-table-column prop="id" label="序号" width="70" />
|
<el-table-column prop="id" label="序号" width="70" />
|
||||||
<el-table-column prop="standardValue" label="标准值(V)" />
|
<el-table-column prop="standardValue" label="标准值(V)" />
|
||||||
@@ -102,7 +102,7 @@ text-align: center; /* 所有单元格文字居中 */
|
|||||||
}
|
}
|
||||||
|
|
||||||
.table-container {
|
.table-container {
|
||||||
max-height: 400px; /* 根据需要调整高度 */
|
/* max-height: 400px; */
|
||||||
overflow-y: auto; /* 允许垂直滚动 */
|
overflow-y: auto; /* 允许垂直滚动 */
|
||||||
overflow-x: hidden; /* 隐藏水平滚动条 */
|
overflow-x: hidden; /* 隐藏水平滚动条 */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<!-- <el-table :key="tableKey" :data="tableData" :row-class-name="tableRowClassName" row-key="id" height="545px" :header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border> -->
|
<!-- <el-table :key="tableKey" :data="tableData" :row-class-name="tableRowClassName" row-key="id" height="545px" :header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border> -->
|
||||||
<!-- <el-table :data="tableData" :row-class-name="tableRowClassName" row-key="id" height="545px" :header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%" border> -->
|
<!-- <el-table :data="tableData" :row-class-name="tableRowClassName" row-key="id" height="545px" :header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%" border> -->
|
||||||
<div class="dialog-content ">
|
<div class="dialog-content ">
|
||||||
<el-table :data="tableData" :cell-class-name="tableCell" row-key="id" height="545px" :header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%" border>
|
<el-table :data="tableData" :cell-class-name="tableCell" row-key="id" height="450px" :header-cell-style="{ background: '#003078', color: '#eee', textAlign: 'center' } " style="width: 100%" border>
|
||||||
<el-table-column fixed prop="scriptItemName" label="检测项目" width="250px">
|
<el-table-column fixed prop="scriptItemName" label="检测项目" width="250px">
|
||||||
<!-- <template #default="scope">
|
<!-- <template #default="scope">
|
||||||
<div :style="{ backgroundColor: '#003078' }">
|
<div :style="{ backgroundColor: '#003078' }">
|
||||||
@@ -226,8 +226,8 @@
|
|||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<div >
|
<div style="height: 98px;">
|
||||||
<el-collapse model-value="0" accordion>
|
<el-collapse model-value="1" accordion>
|
||||||
<el-collapse-item title="检测日志:" name="1">
|
<el-collapse-item title="检测日志:" name="1">
|
||||||
<div ref="scrollContainer" class="dialog-log">
|
<div ref="scrollContainer" class="dialog-log">
|
||||||
<p v-for="(item, index) in testLogList" :key="index" :style="{color:item.type==='error'?'#F56C6C':'var(--el-text-color-regular)'}">
|
<p v-for="(item, index) in testLogList" :key="index" :style="{color:item.type==='error'?'#F56C6C':'var(--el-text-color-regular)'}">
|
||||||
@@ -1925,7 +1925,7 @@ watch(ts, function (newValue, oldValue) {
|
|||||||
margin-bottom:10px;
|
margin-bottom:10px;
|
||||||
}
|
}
|
||||||
.dialog-content{
|
.dialog-content{
|
||||||
max-height: 545px;
|
max-height: 450px;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1939,3 +1939,12 @@ watch(ts, function (newValue, oldValue) {
|
|||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
:deep(.el-button--small) {
|
||||||
|
height: 20px !important;
|
||||||
|
width: 20px !important;
|
||||||
|
}
|
||||||
|
:deep(.el-table--default td ){
|
||||||
|
padding: 5px 0 !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="test-dialog">
|
<div class="test-dialog">
|
||||||
<div class="dialog-left">
|
<div class="dialog-left">
|
||||||
<el-steps direction="vertical" :active="activeIndex" :process-status="currentStepStatus" finish-status="success">
|
<el-steps direction="vertical" :active="activeIndex" :process-status="currentStepStatus"
|
||||||
|
finish-status="success">
|
||||||
<el-step title="开始检测" :description="startTime" />
|
<el-step title="开始检测" :description="startTime" />
|
||||||
<el-step title="GPS完成上送" :description="gpsTime" />
|
<el-step title="GPS完成上送" :description="gpsTime" />
|
||||||
<el-step title="设备开始上送时刻" :description="devStartTime" />
|
<el-step title="设备开始上送时刻" :description="devStartTime" />
|
||||||
@@ -27,20 +28,19 @@
|
|||||||
<div class="dialog-right">
|
<div class="dialog-right">
|
||||||
<div class="right-title">
|
<div class="right-title">
|
||||||
<!-- <div>设备上送时刻表</div> -->
|
<!-- <div>设备上送时刻表</div> -->
|
||||||
|
<span style=" font-size: 18px;font-weight: 600;">
|
||||||
|
设备已合格 <span style="color: #67C23A">{{ qualified }}</span> 台/共 <span style="color: green">4</span> 台
|
||||||
|
</span>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">设备已合格3台/共4台</el-button>
|
<!-- <el-button type="primary" loading v-if="activeIndex > 0 && activeIndex < activeTotalNum">设备已合格3台/共4台</el-button>
|
||||||
<el-button type="primary" disabled="true" v-if="activeIndex === activeTotalNum">设备已合格3台/共4台</el-button>
|
<el-button type="primary" disabled="true" v-if="activeIndex === activeTotalNum">设备已合格3台/共4台</el-button> -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-content">
|
<div class="right-content">
|
||||||
<ProTable
|
<ProTable ref='proTable' :pagination='false' :toolButton='false' :showCard='false' :columns='columns'
|
||||||
ref='proTable'
|
:data='deviceOperatorData' stripe :header-cell-style="{ textAlign: 'center' }"
|
||||||
:pagination = 'false'
|
:cell-style="{ textAlign: 'center' }" style="width: 100%; height:435px" border>
|
||||||
:toolButton = 'false'
|
|
||||||
:columns='columns'
|
|
||||||
:data='deviceOperatorData'
|
|
||||||
stripe :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%; height:390px" border
|
|
||||||
>
|
|
||||||
</ProTable>
|
</ProTable>
|
||||||
|
|
||||||
<!-- <el-table :data="deviceOperatorData" stripe :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border>
|
<!-- <el-table :data="deviceOperatorData" stripe :header-cell-style="{ textAlign: 'center' } " :cell-style="{ textAlign: 'center' }" style="width: 100%" border>
|
||||||
@@ -78,6 +78,7 @@ interface Activity {
|
|||||||
color?: string;
|
color?: string;
|
||||||
icon?: any;
|
icon?: any;
|
||||||
}
|
}
|
||||||
|
const qualified = ref(0)
|
||||||
const activities = ref<Activity[]>([
|
const activities = ref<Activity[]>([
|
||||||
{
|
{
|
||||||
content: '开始检测',
|
content: '开始检测',
|
||||||
@@ -171,14 +172,12 @@ const columns = reactive([
|
|||||||
label: '检测结果',
|
label: '检测结果',
|
||||||
width: 100,
|
width: 100,
|
||||||
render: (scope) => {
|
render: (scope) => {
|
||||||
if(scope.row.Result === '不合格')
|
if (scope.row.Result === '不合格') {
|
||||||
{
|
|
||||||
return (
|
return (
|
||||||
<el-tag type='danger'>{scope.row.Result}</el-tag>
|
<el-tag type='danger'>{scope.row.Result}</el-tag>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
return (
|
return (
|
||||||
<span>{scope.row.Result}</span>
|
<span>{scope.row.Result}</span>
|
||||||
)
|
)
|
||||||
@@ -189,20 +188,17 @@ const columns = reactive([
|
|||||||
//监听testStatus的变化
|
//监听testStatus的变化
|
||||||
watch(testStatus, function (newValue, oldValue) {
|
watch(testStatus, function (newValue, oldValue) {
|
||||||
ts.value = props.testStatus;
|
ts.value = props.testStatus;
|
||||||
if(ts.value==='start')
|
if (ts.value === 'start') {
|
||||||
{
|
|
||||||
ts.value = 'process'
|
ts.value = 'process'
|
||||||
|
|
||||||
let timer = setInterval(() => {
|
let timer = setInterval(() => {
|
||||||
if (activeIndex.value < activeTotalNum.value - 2)
|
if (activeIndex.value < activeTotalNum.value - 2)
|
||||||
activeIndex.value++
|
activeIndex.value++
|
||||||
else if(activeIndex.value === activeTotalNum.value -2)
|
else if (activeIndex.value === activeTotalNum.value - 2) {
|
||||||
{
|
|
||||||
activeIndex.value++
|
activeIndex.value++
|
||||||
activeIndex.value++
|
activeIndex.value++
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
ts.value = 'success'
|
ts.value = 'success'
|
||||||
}
|
}
|
||||||
@@ -224,8 +220,7 @@ function formatDateTime(date) {
|
|||||||
|
|
||||||
watch(activeIndex, function (newValue, oldValue) {
|
watch(activeIndex, function (newValue, oldValue) {
|
||||||
|
|
||||||
if(activeIndex.value === 1)
|
if (activeIndex.value === 1) {
|
||||||
{
|
|
||||||
startTime.value = formatDateTime(new Date());
|
startTime.value = formatDateTime(new Date());
|
||||||
|
|
||||||
// activities.value.length = 0;
|
// activities.value.length = 0;
|
||||||
@@ -237,8 +232,7 @@ if(activeIndex.value === 1)
|
|||||||
// icon: SuccessFilled,
|
// icon: SuccessFilled,
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
if(activeIndex.value === 2)
|
if (activeIndex.value === 2) {
|
||||||
{
|
|
||||||
gpsTime.value = formatDateTime(new Date());
|
gpsTime.value = formatDateTime(new Date());
|
||||||
// activities.value.push({
|
// activities.value.push({
|
||||||
// content: 'GPS上送时刻',
|
// content: 'GPS上送时刻',
|
||||||
@@ -248,8 +242,7 @@ if(activeIndex.value === 2)
|
|||||||
// size: 'large',
|
// size: 'large',
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
if(activeIndex.value === 3)
|
if (activeIndex.value === 3) {
|
||||||
{
|
|
||||||
// activities.value.push({
|
// activities.value.push({
|
||||||
// content: '设备最早上送时刻',
|
// content: '设备最早上送时刻',
|
||||||
// timestamp: '2018-04-03 20:46',
|
// timestamp: '2018-04-03 20:46',
|
||||||
@@ -260,9 +253,9 @@ if(activeIndex.value === 3)
|
|||||||
devStartTime.value = formatDateTime(new Date());
|
devStartTime.value = formatDateTime(new Date());
|
||||||
deviceOperatorData.value.length = 0;
|
deviceOperatorData.value.length = 0;
|
||||||
deviceOperatorData.value = deviceData.value;
|
deviceOperatorData.value = deviceData.value;
|
||||||
|
qualified.value = 3
|
||||||
}
|
}
|
||||||
if(activeIndex.value > 3)
|
if (activeIndex.value > 3) {
|
||||||
{
|
|
||||||
devEndTime.value = formatDateTime(new Date());
|
devEndTime.value = formatDateTime(new Date());
|
||||||
finishTime.value = formatDateTime(new Date());
|
finishTime.value = formatDateTime(new Date());
|
||||||
|
|
||||||
@@ -291,11 +284,11 @@ watch(ts, function (newValue, oldValue) {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
.test-dialog {
|
.test-dialog {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
flex-direction: row; /* 横向排列 */
|
flex-direction: row;
|
||||||
|
/* 横向排列 */
|
||||||
/* margin-top: 20px; */
|
/* margin-top: 20px; */
|
||||||
/* min-height: 300px; */
|
/* min-height: 300px; */
|
||||||
height: 472px;
|
height: 472px;
|
||||||
@@ -303,21 +296,28 @@ watch(ts, function (newValue, oldValue) {
|
|||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
} */
|
} */
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-left {
|
.dialog-left {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dialog-right {
|
.dialog-right {
|
||||||
margin-top: 25px;
|
/* margin-top: 25px;
|
||||||
margin-left: 20px;
|
margin-left: 20px; */
|
||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right-title {
|
.right-title {
|
||||||
|
height: 32px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row; /* 横向排列 */
|
flex-direction: row;
|
||||||
|
/* 横向排列 */
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
margin-bottom: 10px;
|
/* margin-bottom: 10px; */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* width: 100%;
|
/* width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
<el-row :gutter="24" >
|
<el-row :gutter="24" >
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label='生产厂商' prop='manufacturer' :label-width="100">
|
<el-form-item label='设备厂家' prop='manufacturer' :label-width="100">
|
||||||
<el-select v-model="formContent.manufacturer" clearable placeholder="请选择生产厂商">
|
<el-select v-model="formContent.manufacturer" clearable placeholder="请选择生产厂商">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in dictStore.getDictData('Dev_Manufacturers')"
|
v-for="item in dictStore.getDictData('Dev_Manufacturers')"
|
||||||
@@ -52,18 +52,18 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="生产日期" prop="createDate" :label-width="100">
|
<el-form-item label="出厂日期" prop="createDate" :label-width="100">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="formContent.createDate"
|
v-model="formContent.createDate"
|
||||||
placeholder="请选择生产日期"
|
placeholder="请选择出厂日期"
|
||||||
:disabled-date="disabledDate"
|
:disabled-date="disabledDate"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="出厂编号" prop="createId" :label-width="100">
|
<el-form-item label="设备序列号" prop="createId" :label-width="100">
|
||||||
<el-input v-model="formContent.createId" placeholder="请输入出厂编号"/>
|
<el-input v-model="formContent.createId" placeholder="请输入设备序列号"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'createDate',
|
prop: 'createDate',
|
||||||
label: '生产日期',
|
label: '出厂日期',
|
||||||
minWidth: 200,
|
minWidth: 200,
|
||||||
search: {
|
search: {
|
||||||
span: 2,
|
span: 2,
|
||||||
@@ -116,7 +116,7 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'manufacturer',
|
prop: 'manufacturer',
|
||||||
label: '生产厂商',
|
label: '设备厂家',
|
||||||
enum: dictStore.getDictData('Dev_Manufacturers'),
|
enum: dictStore.getDictData('Dev_Manufacturers'),
|
||||||
search: { el: 'select', props: { filterable: true }, order: 1 },
|
search: { el: 'select', props: { filterable: true }, order: 1 },
|
||||||
fieldNames: { label: 'name', value: 'id' },
|
fieldNames: { label: 'name', value: 'id' },
|
||||||
|
|||||||
@@ -4,13 +4,17 @@
|
|||||||
<div class="table-container">
|
<div class="table-container">
|
||||||
<el-table :data="errorData"
|
<el-table :data="errorData"
|
||||||
height="500"
|
height="500"
|
||||||
:header-cell-style="{ textAlign: 'center',backgroundColor: '#003078',color: '#fff' } "
|
:header-cell-style="rowClass"
|
||||||
:cell-style="{ textAlign: 'center' }"
|
:cell-style="{ textAlign: 'center' }"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:span-method="spanMethod"
|
:span-method="spanMethod"
|
||||||
border
|
border
|
||||||
class="custom-table">
|
class="custom-table"
|
||||||
<el-table-column prop="measured" label="被测量" />
|
>
|
||||||
|
<el-table-column label="被测量">
|
||||||
|
<el-table-column prop="col1"/>
|
||||||
|
<el-table-column prop="col2"/>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="deviceLevel" label="检测装置级别" />
|
<el-table-column prop="deviceLevel" label="检测装置级别" />
|
||||||
<el-table-column prop="measurementType" label="测量类型" />
|
<el-table-column prop="measurementType" label="测量类型" />
|
||||||
<el-table-column prop="condition" label="测量条件" />
|
<el-table-column prop="condition" label="测量条件" />
|
||||||
@@ -57,6 +61,17 @@ interface SpanMethodProps {
|
|||||||
columnIndex: number
|
columnIndex: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const rowClass = ({row, column, rowIndex, columnIndex}) => {
|
||||||
|
let res = {
|
||||||
|
textAlign: 'center', backgroundColor: '#003078', color: '#fff'
|
||||||
|
}
|
||||||
|
if (rowIndex === 1) {
|
||||||
|
res = {...res, display: 'none'}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
|
||||||
const spanMethod = ({
|
const spanMethod = ({
|
||||||
row,
|
row,
|
||||||
column,
|
column,
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ const columns = ref<ColumnProps<ErrorSystem.ErrorSystemList>[]>([
|
|||||||
// 打开 drawer(新增、编辑)
|
// 打开 drawer(新增、编辑)
|
||||||
const openDialog = (titleType: string, row: Partial<ErrorSystem.ErrorSystemList> = {}) => {
|
const openDialog = (titleType: string, row: Partial<ErrorSystem.ErrorSystemList> = {}) => {
|
||||||
if(titleType == 'view'){
|
if(titleType == 'view'){
|
||||||
//errorStandardPopup.value?.open(row.name, row)
|
errorStandardPopup.value?.open(row.name, row)
|
||||||
}else{
|
}else{
|
||||||
//errorSystemPopup.value?.open(titleType, row)
|
errorSystemPopup.value?.open(titleType, row)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,18 +11,18 @@
|
|||||||
>
|
>
|
||||||
<!-- 表格 header 按钮 -->
|
<!-- 表格 header 按钮 -->
|
||||||
<template #tableHeader='scope'>
|
<template #tableHeader='scope'>
|
||||||
<el-button v-auth.testSource="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增
|
<el-button :disabled="isDisable" v-auth.testSource="'add'" type='primary' :icon='CirclePlus' @click="openDialog('add')">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button v-auth.testSource="'delete'" type='danger' :icon='Delete'
|
<el-button v-auth.testSource="'delete'" type='danger' :icon='Delete'
|
||||||
plain :disabled='!scope.isSelected' @click='batchDelete(scope.selectedListIds)'>
|
plain :disabled='isDisable || !scope.isSelected' @click='batchDelete(scope.selectedListIds)'>
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
<!-- 表格操作 -->
|
<!-- 表格操作 -->
|
||||||
<template #operation='scope'>
|
<template #operation='scope'>
|
||||||
<el-button type="primary" link :icon='CopyDocument' @click="copyRow(scope.row)">复制</el-button>
|
<!-- <el-button type="primary" link :icon='CopyDocument' @click="copyRow(scope.row)">复制</el-button> -->
|
||||||
<el-button type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
<el-button :disabled="isDisable" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||||
<el-button type='primary' link :icon='Delete' @click='handleDelete(scope.row.id)'>删除</el-button>
|
<el-button :disabled="isDisable" type='primary' link :icon='Delete' @click='handleDelete(scope.row.id)'>删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</ProTable>
|
</ProTable>
|
||||||
|
|
||||||
@@ -40,16 +40,23 @@ import ParameterPopup from '@/views/machine/testSource/components/parameterPopup
|
|||||||
import {reactive, ref, watch} from 'vue'
|
import {reactive, ref, watch} from 'vue'
|
||||||
import {generateUUID} from "@/styles";
|
import {generateUUID} from "@/styles";
|
||||||
import {defineEmits} from "vue/dist/vue";
|
import {defineEmits} from "vue/dist/vue";
|
||||||
import {ElMessage} from "element-plus";
|
import { ElMessage } from 'element-plus'
|
||||||
|
|
||||||
const parameterPopup = ref()
|
const parameterPopup = ref()
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
// ProTable 实例
|
// ProTable 实例
|
||||||
const proTable = ref<ProTableInstance>()
|
const proTable = ref<ProTableInstance>()
|
||||||
const tableData = ref<any[]>([])
|
const tableData = ref<any[]>([])
|
||||||
const props = defineProps<{
|
const props = defineProps({
|
||||||
parameterStr: string;
|
parameterStr: {
|
||||||
}>();
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
isDisable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['change-parameter'])
|
const emit = defineEmits(['change-parameter'])
|
||||||
|
|
||||||
@@ -106,7 +113,14 @@ const getTreeData = (data: TestSource.ParameterType[]): TestSource.ParameterType
|
|||||||
}
|
}
|
||||||
|
|
||||||
const columns = reactive<ColumnProps<any>[]>([
|
const columns = reactive<ColumnProps<any>[]>([
|
||||||
{type: 'selection', fixed: 'left', width: 70},
|
{type: 'selection', fixed: 'left', width: 70,
|
||||||
|
selectable(row, index) {
|
||||||
|
if (props.isDisable) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
},
|
||||||
{type: 'index', fixed: 'left', width: 70, label: '序号'},
|
{type: 'index', fixed: 'left', width: 70, label: '序号'},
|
||||||
{
|
{
|
||||||
prop: 'sourceParamType',
|
prop: 'sourceParamType',
|
||||||
@@ -184,6 +198,8 @@ const getParameter = (data: TestSource.ParameterType) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let index = originalParameterArr.findIndex(item => item.id === data.id)
|
let index = originalParameterArr.findIndex(item => item.id === data.id)
|
||||||
|
|
||||||
|
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
data.id = generateUUID()
|
data.id = generateUUID()
|
||||||
// 新增
|
// 新增
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="dialogTitle" v-model='dialogVisible' @close="close" v-bind="dialogBig">
|
<el-dialog :title="dialogTitle" v-model='dialogVisible' @close="close" v-bind="dialogBig">
|
||||||
<div >
|
<div >
|
||||||
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' >
|
<el-form :model="formContent" ref='dialogFormRef' :rules='rules' :disabled="tableIsDisable">
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<!-- <el-col :span="8">-->
|
<!-- <el-col :span="8">-->
|
||||||
<!-- <el-form-item label="检测源名称" prop="name" >-->
|
<!-- <el-form-item label="检测源名称" prop="name" >-->
|
||||||
@@ -36,11 +36,11 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ParameterTable :parameterStr="formContent.parameter" @change-parameter="changeParameter" ref="parameterTable"/>
|
<ParameterTable :parameterStr="formContent.parameter" @change-parameter="changeParameter" ref="parameterTable" :is-disable="tableIsDisable"/>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div>
|
<div>
|
||||||
<el-button @click='close()'>取 消</el-button>
|
<el-button :disabled="tableIsDisable" @click='close()'>取 消</el-button>
|
||||||
<el-button type="primary" @click='save()'>保存</el-button>
|
<el-button :disabled="tableIsDisable" type="primary" @click='save()'>保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -61,14 +61,13 @@ const dictStore = useDictStore()
|
|||||||
const mode = ref()
|
const mode = ref()
|
||||||
const modeId = ref()
|
const modeId = ref()
|
||||||
const parameterTable = ref()
|
const parameterTable = ref()
|
||||||
|
const tableIsDisable = ref(true)
|
||||||
|
|
||||||
function useMetaInfo() {
|
function useMetaInfo() {
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const titleType = ref('add')
|
const titleType = ref('add')
|
||||||
const formContent = ref<TestSource.ResTestSource>({
|
const formContent = ref<TestSource.ResTestSource>({
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
|
||||||
pattern: modeId.value,
|
pattern: modeId.value,
|
||||||
parameter: '',
|
parameter: '',
|
||||||
type: '',
|
type: '',
|
||||||
@@ -83,7 +82,6 @@ const {dialogVisible, titleType, formContent} = useMetaInfo()
|
|||||||
const resetFormContent = () => {
|
const resetFormContent = () => {
|
||||||
formContent.value = {
|
formContent.value = {
|
||||||
id: '',
|
id: '',
|
||||||
name: '',
|
|
||||||
pattern: modeId.value,
|
pattern: modeId.value,
|
||||||
parameter: '',
|
parameter: '',
|
||||||
type: '',
|
type: '',
|
||||||
@@ -93,8 +91,20 @@ const resetFormContent = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let dialogTitle = computed(() => {
|
let dialogTitle = computed(() => {
|
||||||
return titleType.value === 'add' ? '新增检测源' : '编辑检测源'
|
switch (titleType.value) {
|
||||||
})
|
case 'add':
|
||||||
|
tableIsDisable.value = false
|
||||||
|
return '新增检测源';
|
||||||
|
case 'edit':
|
||||||
|
tableIsDisable.value = false
|
||||||
|
return '编辑检测源';
|
||||||
|
case 'view':
|
||||||
|
tableIsDisable.value = true
|
||||||
|
return '查看检测源';
|
||||||
|
default:
|
||||||
|
return ''; // 默认情况,可选
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let dictTypeCode = computed(() => {
|
let dictTypeCode = computed(() => {
|
||||||
return 'S_Dev_Type_' + dictStore.getDictData('Pattern').find(item => item.id === modeId.value)?.code
|
return 'S_Dev_Type_' + dictStore.getDictData('Pattern').find(item => item.id === modeId.value)?.code
|
||||||
@@ -121,6 +131,7 @@ const close = () => {
|
|||||||
const save = () => {
|
const save = () => {
|
||||||
try {
|
try {
|
||||||
dialogFormRef.value?.validate(async (valid: boolean) => {
|
dialogFormRef.value?.validate(async (valid: boolean) => {
|
||||||
|
console.log("11111111111111111")
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (formContent.value.id) {
|
if (formContent.value.id) {
|
||||||
await updateTestSource(formContent.value);
|
await updateTestSource(formContent.value);
|
||||||
@@ -157,7 +168,7 @@ const open = async (sign: string, data: TestSource.ResTestSource, currentMode: s
|
|||||||
dialogFormRef.value?.resetFields()
|
dialogFormRef.value?.resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
const changeParameter = (parameterArr) => {
|
const changeParameter = (parameterArr: any) => {
|
||||||
formContent.value.parameter = JSON.stringify(parameterArr)
|
formContent.value.parameter = JSON.stringify(parameterArr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- 表格操作 -->
|
<!-- 表格操作 -->
|
||||||
<template #operation='scope'>
|
<template #operation='scope'>
|
||||||
|
<el-button type='primary' link :icon='View' @click="openDialog('view', scope.row)">查看</el-button>
|
||||||
<el-button v-auth.testSource="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
<el-button v-auth.testSource="'edit'" type='primary' link :icon='EditPen' @click="openDialog('edit', scope.row)">编辑</el-button>
|
||||||
<el-button v-auth.testSource="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
<el-button v-auth.testSource="'delete'" type='primary' link :icon='Delete' @click='handleDelete(scope.row)'>删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -57,7 +58,8 @@
|
|||||||
|
|
||||||
// 表格配置项
|
// 表格配置项
|
||||||
const columns = reactive<ColumnProps<TestSource.ResTestSource>[]>([
|
const columns = reactive<ColumnProps<TestSource.ResTestSource>[]>([
|
||||||
{ type: 'selection', fixed: 'left', width: 70 },
|
{ type: 'selection', fixed: 'left', width: 70 ,
|
||||||
|
},
|
||||||
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'name',
|
||||||
|
|||||||
@@ -277,6 +277,7 @@ function getScriptName(id: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getErrSysName(id: string) {
|
function getErrSysName(id: string) {
|
||||||
|
|
||||||
return testErrSystDataList.find(item => item.id == id)?.label
|
return testErrSystDataList.find(item => item.id == id)?.label
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -268,14 +268,13 @@ import {dialogBig} from '@/utils/elementBind'
|
|||||||
import {type Dict} from '@/api/system/dictionary/interface'
|
import {type Dict} from '@/api/system/dictionary/interface'
|
||||||
import {ElMessage, type FormItemRule} from 'element-plus'
|
import {ElMessage, type FormItemRule} from 'element-plus'
|
||||||
import {addDictPq, updateDictPq} from '@/api/system/dictionary/dictPq'
|
import {addDictPq, updateDictPq} from '@/api/system/dictionary/dictPq'
|
||||||
import {computed, type Ref, ref} from 'vue';
|
import {computed, reactive, type Ref, ref} from 'vue';
|
||||||
import {useDictStore} from '@/stores/modules/dict'
|
import {useDictStore} from '@/stores/modules/dict'
|
||||||
|
import selectCheckBox from "@/views/system/dictionary/dictPq/components/selectCheckBox.vue";
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
const selectedStatMethods = ref<string[]>([])
|
const selectedStatMethods = ref<string[]>([])
|
||||||
// 定义弹出组件元信息
|
// 定义弹出组件元信息
|
||||||
const dialogFormRef = ref()
|
const dialogFormRef = ref()
|
||||||
|
|
||||||
function useMetaInfo() {
|
function useMetaInfo() {
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const titleType = ref('add')
|
const titleType = ref('add')
|
||||||
@@ -288,8 +287,8 @@ function useMetaInfo() {
|
|||||||
phase: '',
|
phase: '',
|
||||||
unit: '',
|
unit: '',
|
||||||
type: 'Number',
|
type: 'Number',
|
||||||
harmStart: '',
|
harmStart: null,
|
||||||
harmEnd: '',
|
harmEnd: null,
|
||||||
systemType: '',
|
systemType: '',
|
||||||
resourcesId: '',
|
resourcesId: '',
|
||||||
classId: '',
|
classId: '',
|
||||||
@@ -299,15 +298,15 @@ function useMetaInfo() {
|
|||||||
sort: 100,
|
sort: 100,
|
||||||
defaultValue: '',
|
defaultValue: '',
|
||||||
eventType: '',
|
eventType: '',
|
||||||
maxNum: '',
|
maxNum: null,
|
||||||
minNum: '',
|
minNum: null,
|
||||||
setValue: '',
|
setValue: '',
|
||||||
strlen: '',
|
strlen: null,
|
||||||
tranRule: '',
|
tranRule: '',
|
||||||
curSts: '',
|
curSts: null,
|
||||||
primaryFormula: '',
|
primaryFormula: '',
|
||||||
ctlSts: 0,
|
ctlSts: 0,
|
||||||
storeFlag: 0,
|
storeFlag: '',
|
||||||
tranFlag: 0,
|
tranFlag: 0,
|
||||||
state: 1,
|
state: 1,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -0,0 +1,121 @@
|
|||||||
|
<template>
|
||||||
|
|
||||||
|
<el-select
|
||||||
|
v-model="menusTitle"
|
||||||
|
multiple
|
||||||
|
collapse-tags
|
||||||
|
collapse-tags-tooltip
|
||||||
|
:placeholder="props.placeholder"
|
||||||
|
clearable
|
||||||
|
@clear="clearData"
|
||||||
|
:popper-append-to-body="false"
|
||||||
|
>
|
||||||
|
<!-- @change="changeSelectMenu" -->
|
||||||
|
<el-checkbox v-model="checkedAll" @change="selectAll">全选</el-checkbox>
|
||||||
|
<el-option
|
||||||
|
v-for="(item, index) in menuList"
|
||||||
|
:key="item[props.id]"
|
||||||
|
:value="item[props.id]"
|
||||||
|
>
|
||||||
|
<el-checkbox
|
||||||
|
:label="item[props.label]"
|
||||||
|
size="large"
|
||||||
|
@change="changeCheckBox(item, index)"
|
||||||
|
:checked="isChecked(item, index)"
|
||||||
|
v-model="checkBoxObj[index]"
|
||||||
|
/>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, defineProps, defineEmits } from "vue";
|
||||||
|
const props = defineProps({
|
||||||
|
list: { type: Array, required: true },
|
||||||
|
id: { type: String, required: true },
|
||||||
|
label: { type: String, required: true },
|
||||||
|
modelValue: { type: Array },
|
||||||
|
placeholder: { type: String, default: "选择" },
|
||||||
|
});
|
||||||
|
const emit = defineEmits(["update:modelValue"]);
|
||||||
|
const value = ref("");
|
||||||
|
const checkedAll = ref("false");
|
||||||
|
const menus = ref([]);
|
||||||
|
const menuList = props.list;
|
||||||
|
const checkBoxObj = ref({});
|
||||||
|
menuList.forEach((res, index) => {
|
||||||
|
checkBoxObj.value[index] = false;
|
||||||
|
});
|
||||||
|
const menusTitle = ref([]);
|
||||||
|
const changeSelectMenu = (val) => {};
|
||||||
|
const selectAll = (value) => {
|
||||||
|
menus.value = [];
|
||||||
|
menusTitle.value = [];
|
||||||
|
if (value) {
|
||||||
|
menuList.forEach((item, index) => {
|
||||||
|
menus.value.push(item[props.id]);
|
||||||
|
menusTitle.value.push(item[props.label]);
|
||||||
|
checkBoxObj.value[index] = true;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
menus.value = [];
|
||||||
|
menusTitle.value = [];
|
||||||
|
menuList.forEach((item, index) => {
|
||||||
|
checkBoxObj.value[index] = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
emit("update:modelValue", menus.value);
|
||||||
|
};
|
||||||
|
const isChecked = (item) => {
|
||||||
|
return menus.value.indexOf(item[props.id]) > -1;
|
||||||
|
};
|
||||||
|
const changeCheckBox = (item, index) => {
|
||||||
|
let i = menus.value.indexOf(item[props.id]);
|
||||||
|
if (i == -1) {
|
||||||
|
menus.value.push(item[props.id]);
|
||||||
|
menusTitle.value.push(item[props.label]);
|
||||||
|
} else {
|
||||||
|
menus.value.splice(i, 1);
|
||||||
|
menusTitle.value.splice(i, 1);
|
||||||
|
}
|
||||||
|
if (menus.value.length == menuList.length) {
|
||||||
|
checkedAll.value = true;
|
||||||
|
} else {
|
||||||
|
checkedAll.value = false;
|
||||||
|
}
|
||||||
|
emit("update:modelValue", menus.value);
|
||||||
|
};
|
||||||
|
const clearData = () => {
|
||||||
|
menus.value = [];
|
||||||
|
menusTitle.value = [];
|
||||||
|
emit("update:modelValue", menus.value);
|
||||||
|
checkedAll.value = false;
|
||||||
|
menuList.forEach((item, index) => {
|
||||||
|
checkBoxObj.value[index] = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.el-select-dropdown {
|
||||||
|
.el-checkbox {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding-left: 20px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.el-select-dropdown__item {
|
||||||
|
// background-color: red !important;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.el-select-dropdown.is-multiple .el-select-dropdown__item.is-selected::after{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user