字段调整

This commit is contained in:
GYYM
2024-11-08 13:09:06 +08:00
parent 50bebf451d
commit 74c03a2358
6 changed files with 213 additions and 44 deletions

View File

@@ -23,6 +23,11 @@ export namespace Plan {
export interface ReqPlanParams extends ReqPage,PlanBO { export interface ReqPlanParams extends ReqPage,PlanBO {
} }
// 检测计划 + 检测源
export interface PlanAndSourceBO extends PlanBO {
testSourceName: string;//计划所属检测源
}
// // 检测计划列表 // // 检测计划列表
// export interface PlanList { // export interface PlanList {
// id: string; //检测计划ID // id: string; //检测计划ID

View File

@@ -165,44 +165,84 @@ const testFatherPlanList: Dict[] = [
label: '检测子计划1-2', label: '检测子计划1-2',
}, },
] ]
const planData = ref<Plan.PlanBO[]>([ const planData = ref<Plan.PlanAndSourceBO[]>([
{ {
'id': '1', 'id': '1',
'name': '检测计划1', 'name': '检测计划1',
'pattern':'1', 'pattern':'1',
'dataSource_Id':'1', "testSourceName":'标准源-福禄克-6100A',
'script_Id':'1', 'dataSource_Id':'1',
'error_Sys_Id':'1', 'script_Id':'1',
'test_State':'1', 'error_Sys_Id':'1',
'report_State':'1', 'test_State':'1',
'result':'1', 'report_State':'1',
}, 'result':'1',
{ },
'id': '2', {
'name': '检测子计划2', 'id': '2',
'pattern':'1', 'name': '检测计划2',
'father_Plan_Id':'1', 'pattern':'1',
'dataSource_Id':'2', "testSourceName":'高精度设备-PQV520-1,高精度设备-PQV520-2',
'script_Id':'2', 'father_Plan_Id':'1',
'error_Sys_Id':'2', 'dataSource_Id':'2',
'test_State':'2', 'script_Id':'2',
'report_State':'2', 'error_Sys_Id':'2',
'result':'0', 'test_State':'2',
}, 'report_State':'2',
{ 'result':'0',
'id': '3', },
'name': '检测子计划1-2', {
'pattern':'1', 'id': '3',
'father_Plan_Id':'1', 'name': '检测子计划3',
'dataSource_Id':'3', 'pattern':'1',
'script_Id':'3', "testSourceName":'标准源-丹迪克-DKLN1',
'error_Sys_Id':'3', 'father_Plan_Id':'1',
'test_State':'1', 'dataSource_Id':'3',
'report_State':'1', 'script_Id':'3',
'result':'1', 'error_Sys_Id':'3',
}, 'test_State':'1',
'report_State':'1',
'result':'1',
},
]) ])
// const planData = ref<Plan.PlanBO[]>([
// {
// 'id': '1',
// 'name': '检测计划1',
// 'pattern':'1',
// 'dataSource_Id':'1',
// 'script_Id':'1',
// 'error_Sys_Id':'1',
// 'test_State':'1',
// 'report_State':'1',
// 'result':'1',
// },
// {
// 'id': '2',
// 'name': '检测子计划2',
// 'pattern':'1',
// 'father_Plan_Id':'1',
// 'dataSource_Id':'2',
// 'script_Id':'2',
// 'error_Sys_Id':'2',
// 'test_State':'2',
// 'report_State':'2',
// 'result':'0',
// },
// {
// 'id': '3',
// 'name': '检测子计划1-2',
// 'pattern':'1',
// 'father_Plan_Id':'1',
// 'dataSource_Id':'3',
// 'script_Id':'3',
// 'error_Sys_Id':'3',
// 'test_State':'1',
// 'report_State':'1',
// 'result':'1',
// },
// ])
// const plandata = ref<Plan.PlanList[]>([ // const plandata = ref<Plan.PlanList[]>([
// { // {

View File

@@ -18,12 +18,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from 'vue'
import { Role } from '@/api/role/interface'
import { dialogBig } from '@/utils/elementBind'
const {dialogVisible,data} = defineProps<{ const {dialogVisible,data} = defineProps<{
dialogVisible: boolean; dialogVisible: boolean;
title: string; title: string;
data: Role.ResRoleList; data: Role.ResRoleLimport { Role } from '@/api/role/interface'
import { dialogBig } from '@/utils/elementBind'
ist;
}>() }>()
// const leftvalue = ref<Role.Permission[]>([]) // const leftvalue = ref<Role.Permission[]>([])

View File

@@ -110,9 +110,12 @@ defineExpose({ getTreeData })
.tree_container { .tree_container {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
// width: 100%;
// overflow-x: auto;
.el-tree { .el-tree {
height: 100%; height: 100%;
// width: 2000px;
} }
} }
} }

View File

@@ -0,0 +1,106 @@
<template>
<!-- 权限信息弹出框 -->
<el-dialog :model-value="dialogVisible" title="编辑计划所属设备" v-bind="dialogBig" @close="handleCancel" width="600" draggable>
<div>
<el-transfer v-model="value"
filterable
:filter-method="filterMethod"
filter-placeholder="请输入内容搜索"
:data="data"
:titles="['未绑定设备', '计划所属设备']"/>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleCancel">
保存
</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import type { Device } from '@/api/device/interface'
import deviceDataList from '@/api/device/deviceData'
import { dialogBig } from '@/utils/elementBind'
const {dialogVisible} = defineProps<{
dialogVisible: boolean;
}>()
interface Option {
key: number
label: string
initial: string
}
const generateData = () => {
const data: Option[] = []
const states = [
'模拟装置1',
'模拟装置2',
'模拟装置3',
'模拟装置4',
'中电送检装置',
'易司拓测试装置',
'山大电力测试装置1',
'山大电力测试装置2',
]
const initials = ['CA', 'IL', 'MD', 'TX', 'FL', 'CO', 'CT', 'GT']
states.forEach((city, index) => {
data.push({
label: city,
key: index,
initial: initials[index],
})
})
return data
}
const generateValue = () => {
const data: number[] = []
const states = [
'山大电力测试装置1',
'山大电力测试装置2',
]
const initials = ['AB', 'CD']
states.forEach((city, index) => {
const key = states.indexOf(city)
if (key !== -1) {
data.push(key)
}
})
return data
}
// const generateValue = () => {
// const data: Option[] = []
// const states = [
// '山大电力测试装置1',
// '山大电力测试装置2',
// ]
// const initials = ['AB', 'CD']
// states.forEach((city, index) => {
// data.push({
// label: city,
// key: index,
// initial: initials[index],
// })
// })
// return data
// }
const data = ref<Option[]>(generateData())
const value = ref<number[]>(generateValue())
const emit = defineEmits<{
(e:'update:visible',value:boolean):void;
}>();
const handleCancel = () => {
emit('update:visible',false)
}
const filterMethod = (query, item) => {
return item.label.toLowerCase().includes(query.toLowerCase())
}
</script>

View File

@@ -36,6 +36,10 @@
/> />
</div> </div>
<devTransfer
:dialogVisible=devTransferVisible
@update:visible='devTransferVisible = $event'
/>
<DeviceOpen :width='viewWidth' :height='viewHeight' ref='openDeviceView' /> <DeviceOpen :width='viewWidth' :height='viewHeight' ref='openDeviceView' />
<SourceOpen :width='viewWidth' :height='viewHeight' ref='openSourceView' /> <SourceOpen :width='viewWidth' :height='viewHeight' ref='openSourceView' />
</template> </template>
@@ -51,6 +55,7 @@ import type { Plan } from '@/api/plan/interface'
import planPopup from "@/views/plan/planList/components/planPopup.vue"; // 导入子组件 import planPopup from "@/views/plan/planList/components/planPopup.vue"; // 导入子组件
import DeviceOpen from '@/views/plan/planList/components/devPopup.vue' import DeviceOpen from '@/views/plan/planList/components/devPopup.vue'
import SourceOpen from '@/views/plan/planList/components/sourcePopup.vue' import SourceOpen from '@/views/plan/planList/components/sourcePopup.vue'
import devTransfer from './components/devTransfer.vue'
import { useViewSize } from '@/hooks/useViewSize' import { useViewSize } from '@/hooks/useViewSize'
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { useDictStore } from '@/stores/modules/dict' import { useDictStore } from '@/stores/modules/dict'
@@ -65,6 +70,8 @@ const defaultUnits = '日'; // 默认的单位
const { popupBaseView, viewWidth, viewHeight } = useViewSize() const { popupBaseView, viewWidth, viewHeight } = useViewSize()
const openDeviceView = ref() const openDeviceView = ref()
const openSourceView = ref() const openSourceView = ref()
const devTransferVisible = ref(false)
// ProTable 实例 // ProTable 实例
const proTable = ref<ProTableInstance>() const proTable = ref<ProTableInstance>()
// const planData = planData // const planData = planData
@@ -91,17 +98,17 @@ const dialogForm = ref<Plan.PlanBO>({
// 表格配置项 // 表格配置项
const columns = reactive<ColumnProps<Plan.PlanBO>[]>([ const columns = reactive<ColumnProps<Plan.PlanBO>[]>([
{ type: 'selection', fixed: 'left', width: 70 }, { type: 'selection', fixed: 'left', width: 70 },
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
{ {
prop: 'name', prop: 'name',
label: '检测计划名称', label: '检测计划名称',
width: 200, width: 200,
search: { el: 'input' },
}, },
{ {
prop: 'dataSource_Id', prop: 'testSourceName',
label: '数据源名称', label: '检测源名称',
width: 200, width: 200,
enum: testSoureDataList,
fieldNames: { label: 'label', value: 'id' },
}, },
{ {
prop: 'script_Id', prop: 'script_Id',
@@ -117,6 +124,13 @@ const columns = reactive<ColumnProps<Plan.PlanBO>[]>([
enum: testErrSystDataList, enum: testErrSystDataList,
fieldNames: { label: 'label', value: 'id' }, fieldNames: { label: 'label', value: 'id' },
}, },
{
prop: 'dataSource_Id',
label: '数据源名称',
width: 200,
enum: testSoureDataList,
fieldNames: { label: 'label', value: 'id' },
},
{ {
prop: 'test_State', prop: 'test_State',
label: '检测状态', label: '检测状态',
@@ -270,7 +284,8 @@ const handleRowClick = (planSystem: Plan.PlanBO) =>{
} }
const showDeviceOpen = (planSystem: Plan.PlanBO) => { const showDeviceOpen = (planSystem: Plan.PlanBO) => {
openDeviceView.value.open('计划设备列表') devTransferVisible.value = true;
//openDeviceView.value.open('计划设备列表')
} }
const showtestSourceOpen=(planSystem: Plan.PlanBO)=>{ const showtestSourceOpen=(planSystem: Plan.PlanBO)=>{