字段调整
This commit is contained in:
106
frontend/src/views/plan/planList/components/devTransfer.vue
Normal file
106
frontend/src/views/plan/planList/components/devTransfer.vue
Normal 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>
|
||||
@@ -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)=>{
|
||||
|
||||
Reference in New Issue
Block a user