微调
This commit is contained in:
@@ -193,24 +193,13 @@ const close = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 打开弹窗,可能是新增,也可能是编辑
|
// 打开弹窗,可能是新增,也可能是编辑
|
||||||
const open = async (sign: string, data: DevType.ResPqDevType) => {
|
const open = async (sign: string, data: DevType.ResPqDevType,icd: ICD.ResICD[]) => {
|
||||||
// 重置表单
|
// 重置表单
|
||||||
dialogFormRef.value?.resetFields()
|
dialogFormRef.value?.resetFields()
|
||||||
titleType.value = sign
|
titleType.value = sign
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
|
|
||||||
const response = await getICDAllList({
|
icdOptions.value = icd
|
||||||
id: '',
|
|
||||||
name: '',
|
|
||||||
path: '',
|
|
||||||
state: 1
|
|
||||||
})
|
|
||||||
icdOptions.value = (response.data as ICD.ResICD[]).map(item => ({
|
|
||||||
id: item.id,
|
|
||||||
name: item.name,
|
|
||||||
path: item.path,
|
|
||||||
state: item.state,
|
|
||||||
}))
|
|
||||||
|
|
||||||
if (data.id) {
|
if (data.id) {
|
||||||
formContent.value = { ...data }
|
formContent.value = { ...data }
|
||||||
|
|||||||
@@ -41,25 +41,23 @@
|
|||||||
getDevTypeList,
|
getDevTypeList,
|
||||||
deleteDevType,
|
deleteDevType,
|
||||||
} from '@/api/device/devType/index.ts'
|
} from '@/api/device/devType/index.ts'
|
||||||
import { reactive, ref } from 'vue'
|
import { onBeforeMount, reactive, ref } from 'vue'
|
||||||
import { useModeStore, useAppSceneStore } from '@/stores/modules/mode'
|
import { useModeStore, useAppSceneStore } from '@/stores/modules/mode'
|
||||||
|
import { getICDAllList } from '@/api/device/icd'
|
||||||
|
import type { ICD } from '@/api/device/interface/icd'
|
||||||
|
|
||||||
defineOptions({
|
// defineOptions({
|
||||||
name: 'devType',
|
// name: 'devType',
|
||||||
})
|
// })
|
||||||
const modeStore = useModeStore()
|
const modeStore = useModeStore()
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
// ProTable 实例
|
// ProTable 实例
|
||||||
const proTable = ref<ProTableInstance>()
|
const proTable = ref<ProTableInstance>()
|
||||||
const devTypePopup = ref()
|
const devTypePopup = ref()
|
||||||
|
const icdOptions = ref<ICD.ResICD[]>([])
|
||||||
|
|
||||||
const getTableList = async (params: any) => {
|
const getTableList = async (params: any) => {
|
||||||
let newParams = JSON.parse(JSON.stringify(params))
|
let newParams = JSON.parse(JSON.stringify(params))
|
||||||
// newParams.searchEndTime = endDate.value
|
|
||||||
// newParams.searchBeginTime = startDate.value
|
|
||||||
// const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id//获取数据字典中对应的id
|
|
||||||
// newParams.pattern = patternId
|
|
||||||
return getDevTypeList(newParams)
|
return getDevTypeList(newParams)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,25 +70,42 @@
|
|||||||
prop: 'name',
|
prop: 'name',
|
||||||
label: '名称',
|
label: '名称',
|
||||||
search: { el: 'input' },
|
search: { el: 'input' },
|
||||||
minWidth: 200,
|
minWidth: 150,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'power',
|
||||||
|
label: '工作电源',
|
||||||
|
minWidth: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'devChns',
|
prop: 'devChns',
|
||||||
label: '通道数',
|
label: '通道数',
|
||||||
minWidth: 110,
|
minWidth: 100,
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'devVolt',
|
prop: 'devVolt',
|
||||||
label: '额定电压(V)',
|
label: '额定电压(V)',
|
||||||
minWidth: 130,
|
minWidth: 100,
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'devCurr',
|
prop: 'devCurr',
|
||||||
label: '额定电流(A)',
|
label: '额定电流(A)',
|
||||||
minWidth: 130,
|
minWidth: 100,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'reportName',
|
||||||
|
label: '报告模版名称',
|
||||||
|
minWidth: 150,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'icd',
|
||||||
|
label: '设备关联ICD',
|
||||||
|
minWidth: 200,
|
||||||
|
render: (scope) => {
|
||||||
|
// 查找ICD名称
|
||||||
|
const name = icdOptions.value.find(option => option.id === scope.row.icd)
|
||||||
|
return <span>{name?.name}</span>
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
@@ -114,16 +129,10 @@
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
// 处理日期变化的回调函数
|
|
||||||
const startDate = ref('')
|
|
||||||
const endDate = ref('')
|
|
||||||
const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
|
|
||||||
startDate.value = startDateTemp
|
|
||||||
endDate.value = endDateTemp
|
|
||||||
}
|
|
||||||
// 打开 drawer(新增、编辑)
|
// 打开 drawer(新增、编辑)
|
||||||
const openDialog = (titleType: string, row: Partial<DevType.ResPqDevType> = {}) => {
|
const openDialog = (titleType: string, row: Partial<DevType.ResPqDevType> = {}) => {
|
||||||
devTypePopup.value?.open(titleType, row)
|
devTypePopup.value?.open(titleType, row,icdOptions.value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -144,5 +153,21 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
onBeforeMount(async () => {
|
||||||
|
const response = await getICDAllList({
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
path: '',
|
||||||
|
state: 1
|
||||||
|
})
|
||||||
|
icdOptions.value = (response.data as ICD.ResICD[]).map(item => ({
|
||||||
|
id: item.id,
|
||||||
|
name: item.name,
|
||||||
|
path: item.path,
|
||||||
|
state: item.state,
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
Reference in New Issue
Block a user