模式切换
This commit is contained in:
@@ -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; //限值字段名称
|
||||||
|
|||||||
@@ -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,9 +39,13 @@
|
|||||||
</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";
|
||||||
|
import { useAuthStore } from "@/stores/modules/auth";
|
||||||
const title = ref("模拟式模块");
|
const title = ref("模拟式模块");
|
||||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const authStore = useAuthStore();
|
||||||
const modeStore = useModeStore();
|
const modeStore = useModeStore();
|
||||||
watch(() => modeStore.currentMode, (newVal) => {
|
watch(() => modeStore.currentMode, (newVal) => {
|
||||||
//console.log('当前模式:', newVal);
|
//console.log('当前模式:', newVal);
|
||||||
@@ -59,6 +63,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";
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ function useMetaInfo() {
|
|||||||
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: '',
|
||||||
@@ -157,7 +155,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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -279,6 +279,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