刷新饼图
This commit is contained in:
@@ -172,15 +172,7 @@ import MonitorTable from '@/views/machine/device/components/monitorTab.vue';
|
||||
const MonIsShow = ref(false)
|
||||
const DevIsShow = ref(false)
|
||||
// 存储设备类型选项
|
||||
const devTypeOptions = ref<{
|
||||
id: string;
|
||||
name: string ,
|
||||
icd:string ,
|
||||
power:string,
|
||||
devVolt:number,
|
||||
devCurr:number,
|
||||
devChns:number,
|
||||
}[]>([])
|
||||
const devTypeOptions = ref<Device.ResDev[]>([])
|
||||
// const IsPasswordShow = ref(false)
|
||||
const dictStore = useDictStore()
|
||||
const mode = ref()
|
||||
@@ -191,24 +183,6 @@ const disabledDate = (time: Date) => {
|
||||
return time.getTime() > Date.now()
|
||||
}
|
||||
|
||||
// 获取设备类型选项
|
||||
const fetchDevTypeOptions = async () => {
|
||||
try {
|
||||
const response = await getPqDev()
|
||||
devTypeOptions.value = response.data.map(item => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
icd: item.icd,
|
||||
power: item.power,
|
||||
devVolt: item.devVolt,
|
||||
devCurr: item.devCurr,
|
||||
devChns: item.devChns
|
||||
}))
|
||||
} catch (error) {
|
||||
console.error('获取设备类型选项失败', error)
|
||||
}
|
||||
}
|
||||
|
||||
function useMetaInfo() {
|
||||
const dialogVisible = ref(false)
|
||||
const titleType = ref('add')
|
||||
@@ -381,8 +355,8 @@ const rules = computed(() => {
|
||||
|
||||
|
||||
// 打开弹窗,可能是新增,也可能是编辑
|
||||
const open = async (sign: string, data: Device.ResPqDev,currentMode: string,currentScene: string ) => {
|
||||
fetchDevTypeOptions()
|
||||
const open = async (sign: string, data: Device.ResPqDev,currentMode: string,currentScene: string,devType:Device.ResDev[] ) => {
|
||||
devTypeOptions.value = devType
|
||||
mode.value = currentMode
|
||||
scene.value = currentScene
|
||||
titleType.value = sign
|
||||
@@ -454,7 +428,7 @@ const handleDevTypeChange = (value: string) => {
|
||||
|
||||
const handleInput = (value: string) => {
|
||||
// 在这里处理选中事件的逻辑
|
||||
formContent.value.name = value
|
||||
formContent.value.name = value
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ import { getPqDevList, deletePqDev, exportPqDev, downloadTemplate, importPqDev,g
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import { computed, onBeforeMount, onMounted, reactive, ref } from 'vue'
|
||||
import { useModeStore , useAppSceneStore} from '@/stores/modules/mode'; // 引入模式 store
|
||||
import { forEach } from 'lodash'
|
||||
|
||||
const modeStore = useModeStore();
|
||||
const dictStore = useDictStore()
|
||||
@@ -51,19 +50,11 @@ const appSceneStore = useAppSceneStore()
|
||||
// ProTable 实例
|
||||
const proTable = ref<ProTableInstance>()
|
||||
const devicePopup = ref()
|
||||
const ConditionsIsShow = ref(false)
|
||||
|
||||
|
||||
const boundPqDevList=ref<Device.ReqPqDevParams[]>([])//根据检测计划id查询出所有已绑定的设备
|
||||
// 存储设备类型选项
|
||||
const devTypeOptions = ref<{
|
||||
id: string;
|
||||
name: string ,
|
||||
icd:string ,
|
||||
power:string,
|
||||
devVolt:number,
|
||||
devCurr:number,
|
||||
devChns:number,
|
||||
}[]>([])
|
||||
const devTypeOptions = ref<Device.ResDev[]>([])
|
||||
|
||||
const getTableList = async (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params))
|
||||
@@ -158,7 +149,7 @@ const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
|
||||
}
|
||||
// 打开 drawer(新增、编辑)
|
||||
const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
|
||||
devicePopup.value?.open(titleType, row,modeStore.currentMode,appSceneStore.currentScene)
|
||||
devicePopup.value?.open(titleType, row,modeStore.currentMode,appSceneStore.currentScene,devTypeOptions.value)
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +200,7 @@ const importFile = async () => {
|
||||
|
||||
onBeforeMount(async () => {
|
||||
const response = await getPqDev()
|
||||
devTypeOptions.value = response.data.map(item => ({
|
||||
devTypeOptions.value = (response.data as Device.ResDev[]).map(item => ({
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
icd: item.icd,
|
||||
|
||||
Reference in New Issue
Block a user