字段调整

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 PlanAndSourceBO extends PlanBO {
testSourceName: string;//计划所属检测源
}
// // 检测计划列表
// export interface PlanList {
// id: string; //检测计划ID

View File

@@ -166,11 +166,12 @@ const testFatherPlanList: Dict[] = [
},
]
const planData = ref<Plan.PlanBO[]>([
const planData = ref<Plan.PlanAndSourceBO[]>([
{
'id': '1',
'name': '检测计划1',
'pattern':'1',
"testSourceName":'标准源-福禄克-6100A',
'dataSource_Id':'1',
'script_Id':'1',
'error_Sys_Id':'1',
@@ -180,8 +181,9 @@ const planData = ref<Plan.PlanBO[]>([
},
{
'id': '2',
'name': '检测计划2',
'name': '检测计划2',
'pattern':'1',
"testSourceName":'高精度设备-PQV520-1,高精度设备-PQV520-2',
'father_Plan_Id':'1',
'dataSource_Id':'2',
'script_Id':'2',
@@ -192,8 +194,9 @@ const planData = ref<Plan.PlanBO[]>([
},
{
'id': '3',
'name': '检测子计划1-2',
'name': '检测子计划3',
'pattern':'1',
"testSourceName":'标准源-丹迪克-DKLN1',
'father_Plan_Id':'1',
'dataSource_Id':'3',
'script_Id':'3',
@@ -203,6 +206,43 @@ const planData = ref<Plan.PlanBO[]>([
'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[]>([
// {

View File

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

View File

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