刷新饼图
This commit is contained in:
@@ -19,6 +19,6 @@ VITE_API_URL=/api
|
||||
|
||||
# 开发环境跨域代理,支持配置多个
|
||||
|
||||
VITE_PROXY=[["/api","http://192.168.1.125:18092/"]]
|
||||
VITE_PROXY=[["/api","http://192.168.1.124:18092/"]]
|
||||
#VITE_PROXY=[["/api","http://192.168.1.125:18092/"]]
|
||||
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文
|
||||
|
||||
@@ -60,6 +60,19 @@ export namespace Device {
|
||||
power: string;
|
||||
}
|
||||
|
||||
|
||||
export interface ResDev{
|
||||
id: string;
|
||||
name: string ,
|
||||
icd:string ,
|
||||
power:string,
|
||||
devVolt:number,
|
||||
devCurr:number,
|
||||
devChns:number,
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 被检设备表格查询分页返回的对象;
|
||||
*/
|
||||
|
||||
@@ -36,3 +36,4 @@ export const useModeStore = defineStore('mode', {
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -91,9 +91,9 @@
|
||||
>报告下载</el-button
|
||||
>
|
||||
<!-- :disabled='!scope.isSelected' -->
|
||||
<el-button type="primary" :icon="Postcard" @click="handleTest('批量生成')" v-if="form.activeTabs === 3"
|
||||
<!-- <el-button type="primary" :icon="Postcard" @click="handleTest('批量生成')" v-if="form.activeTabs === 3"
|
||||
>报告生成</el-button
|
||||
>
|
||||
> -->
|
||||
|
||||
<!-- :disabled="!scope.isSelected || scope.selectedList.filter((item) => item.check_State === '检测完成').length === 0" -->
|
||||
<el-button type="primary" :icon="Notebook" @click="handleTest('批量归档')" v-if="form.activeTabs === 4"
|
||||
@@ -210,7 +210,7 @@
|
||||
:dialogTitle="dialogTitle"
|
||||
@update:visible="dialogFormVisible = $event"
|
||||
/> -->
|
||||
<TestPopup ref="testPopup"></TestPopup>
|
||||
<TestPopup ref="testPopup" @quitClicked="handleQuitClicked" ></TestPopup>
|
||||
|
||||
<reportPopup
|
||||
:visible="reportDialogVisible"
|
||||
@@ -251,7 +251,7 @@ import reportPopup from "./reportPopup.vue";
|
||||
import dataCheckPopup from "./dataCheckSingleChannelSingleTestPopup.vue";
|
||||
import dataCheckChangeErrSysPopup from "./dataCheckChangeErrSysPopup.vue";
|
||||
import { getBoundPqDevList } from '@/api/plan/plan.ts'
|
||||
import { onMounted, reactive, ref, watch } from "vue";
|
||||
import { onBeforeMount, onMounted, reactive, ref, watch } from "vue";
|
||||
import { useDictStore } from '@/stores/modules/dict'
|
||||
import ChannelsTest from './channelsTest.vue'
|
||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||
@@ -331,6 +331,9 @@ isTimeCheck: {
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'batchGenerateClicked'): void;
|
||||
}>();
|
||||
|
||||
// 存储设备类型选项
|
||||
const devTypeOptions = ref<{
|
||||
@@ -449,7 +452,6 @@ const getTableList = async (params: any) => {
|
||||
'name':form.value.search
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// 表格配置项
|
||||
@@ -985,9 +987,10 @@ const handleTest = async (val:string) => {
|
||||
)
|
||||
return
|
||||
}
|
||||
if(val==='批量生成')
|
||||
if(val==='批量下载')
|
||||
{
|
||||
reportDialogVisible.value = true;
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1025,6 +1028,7 @@ const openDrawer = (title: string, row: any) => {
|
||||
if(title === '生成')
|
||||
{
|
||||
//reportDialogVisible.value = true;
|
||||
emit('batchGenerateClicked'); // 触发事件
|
||||
useDownload(downloadDevData,'调试报告'+formatDate(new Date()), {planId:checkStore.planId,devId:row.id}, false,'.docx')
|
||||
}
|
||||
|
||||
@@ -1040,6 +1044,7 @@ const openDrawer = (title: string, row: any) => {
|
||||
|
||||
if (title === '归档')
|
||||
{
|
||||
emit('batchGenerateClicked'); // 触发事件
|
||||
documentedPqDev([row.id])
|
||||
// const loading = ElLoading.service({
|
||||
// lock: true,
|
||||
@@ -1087,6 +1092,14 @@ onBeforeMount(async () => {
|
||||
devChns: item.devChns
|
||||
}))
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
const handleQuitClicked = () => {
|
||||
emit('batchGenerateClicked'); // 触发事件
|
||||
};
|
||||
|
||||
defineExpose({ changeActiveTabs });
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -615,6 +615,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
||||
|
||||
}, {deep: true})
|
||||
|
||||
|
||||
// 更新进度条
|
||||
const updatePercentage = () => {
|
||||
if (activeIndex < checkTotal) {
|
||||
@@ -622,7 +623,6 @@ const updatePercentage = () => {
|
||||
} else {
|
||||
percentage.value = 100;
|
||||
emit('update:testStatus', 'success')
|
||||
|
||||
ElMessageBox.alert('检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测完成', {
|
||||
confirmButtonText: '确定',
|
||||
})
|
||||
|
||||
@@ -302,6 +302,8 @@ const handleSubmit = () => {
|
||||
sendReCheck()
|
||||
|
||||
|
||||
}else if (TestStatus.value == 'success') {
|
||||
emit('quitClicked'); // 触发事件
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -312,6 +314,10 @@ const handleSubmit = () => {
|
||||
};
|
||||
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'quitClicked'): void;
|
||||
}>();
|
||||
|
||||
watch(preTestStatus, function (newValue, oldValue) {
|
||||
console.log(newValue, oldValue);
|
||||
|
||||
@@ -481,6 +487,7 @@ const beforeClose = (done: () => void) => {
|
||||
// })
|
||||
}
|
||||
const handleCancel = () => {
|
||||
emit('quitClicked'); // 触发事件
|
||||
// clearData()
|
||||
// emit('update:visible', false); // 关闭对话框
|
||||
testRef.value?.clear()
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<el-tab-pane :label='tabLabel1' :style='{ height: tabPaneHeight}'>
|
||||
<!-- 列表数据 -->
|
||||
<div class='container_table' :style='{ height: tableHeight }'>
|
||||
<Table ref='tableRef1' :id='currentId' :isTimeCheck='isTimeCheck' :plan = 'select_Plan'></Table>
|
||||
<Table ref='tableRef1' :id='currentId' :isTimeCheck='isTimeCheck' :plan = 'select_Plan' @batchGenerateClicked="handleBatchGenerate"></Table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@@ -441,7 +441,11 @@ onUnmounted(() => {
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
const handleBatchGenerate = () => {
|
||||
console.log('批量生成按钮被点击了');
|
||||
// 在这里添加其他逻辑,比如显示对话框、更新状态等
|
||||
getPieData(currentId.value)
|
||||
};
|
||||
</script>
|
||||
<style lang='scss' scoped>
|
||||
|
||||
|
||||
@@ -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