刷新饼图
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.125:18092/"]]
|
||||||
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文
|
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文
|
||||||
|
|||||||
@@ -60,6 +60,19 @@ export namespace Device {
|
|||||||
power: string;
|
power: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface ResDev{
|
||||||
|
id: string;
|
||||||
|
name: string ,
|
||||||
|
icd:string ,
|
||||||
|
power:string,
|
||||||
|
devVolt:number,
|
||||||
|
devCurr:number,
|
||||||
|
devChns:number,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 被检设备表格查询分页返回的对象;
|
* 被检设备表格查询分页返回的对象;
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,4 +35,5 @@ export const useModeStore = defineStore('mode', {
|
|||||||
localStorage.setItem('currentScene', sceneName); // 保存到 localStorage
|
localStorage.setItem('currentScene', sceneName); // 保存到 localStorage
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -91,9 +91,9 @@
|
|||||||
>报告下载</el-button
|
>报告下载</el-button
|
||||||
>
|
>
|
||||||
<!-- :disabled='!scope.isSelected' -->
|
<!-- :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
|
>报告生成</el-button
|
||||||
>
|
> -->
|
||||||
|
|
||||||
<!-- :disabled="!scope.isSelected || scope.selectedList.filter((item) => item.check_State === '检测完成').length === 0" -->
|
<!-- :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"
|
<el-button type="primary" :icon="Notebook" @click="handleTest('批量归档')" v-if="form.activeTabs === 4"
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
:dialogTitle="dialogTitle"
|
:dialogTitle="dialogTitle"
|
||||||
@update:visible="dialogFormVisible = $event"
|
@update:visible="dialogFormVisible = $event"
|
||||||
/> -->
|
/> -->
|
||||||
<TestPopup ref="testPopup"></TestPopup>
|
<TestPopup ref="testPopup" @quitClicked="handleQuitClicked" ></TestPopup>
|
||||||
|
|
||||||
<reportPopup
|
<reportPopup
|
||||||
:visible="reportDialogVisible"
|
:visible="reportDialogVisible"
|
||||||
@@ -251,7 +251,7 @@ import reportPopup from "./reportPopup.vue";
|
|||||||
import dataCheckPopup from "./dataCheckSingleChannelSingleTestPopup.vue";
|
import dataCheckPopup from "./dataCheckSingleChannelSingleTestPopup.vue";
|
||||||
import dataCheckChangeErrSysPopup from "./dataCheckChangeErrSysPopup.vue";
|
import dataCheckChangeErrSysPopup from "./dataCheckChangeErrSysPopup.vue";
|
||||||
import { getBoundPqDevList } from '@/api/plan/plan.ts'
|
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 { useDictStore } from '@/stores/modules/dict'
|
||||||
import ChannelsTest from './channelsTest.vue'
|
import ChannelsTest from './channelsTest.vue'
|
||||||
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store
|
||||||
@@ -331,6 +331,9 @@ isTimeCheck: {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'batchGenerateClicked'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
// 存储设备类型选项
|
// 存储设备类型选项
|
||||||
const devTypeOptions = ref<{
|
const devTypeOptions = ref<{
|
||||||
@@ -437,19 +440,18 @@ const getTableList = async (params: any) => {
|
|||||||
}
|
}
|
||||||
if(props.id){
|
if(props.id){
|
||||||
const checkStateList = ref<any>()
|
const checkStateList = ref<any>()
|
||||||
if(form.value.checkStatus != null){
|
if(form.value.checkStatus != null){
|
||||||
checkStateList.value = [form.value.checkStatus]
|
checkStateList.value = [form.value.checkStatus]
|
||||||
}else{
|
}else{
|
||||||
checkStateList.value = checkStateTable.value
|
checkStateList.value = checkStateTable.value
|
||||||
}
|
}
|
||||||
return getBoundPqDevList({'planId': props.id,
|
return getBoundPqDevList({'planId': props.id,
|
||||||
'checkStateList': checkStateList.value,
|
'checkStateList': checkStateList.value,
|
||||||
'checkResult': form.value.checkResult,
|
'checkResult': form.value.checkResult,
|
||||||
'reportState': form.value.checkReportStatus,
|
'reportState': form.value.checkReportStatus,
|
||||||
'name':form.value.search
|
'name':form.value.search
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 表格配置项
|
// 表格配置项
|
||||||
@@ -985,9 +987,10 @@ const handleTest = async (val:string) => {
|
|||||||
)
|
)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(val==='批量生成')
|
if(val==='批量下载')
|
||||||
{
|
{
|
||||||
reportDialogVisible.value = true;
|
reportDialogVisible.value = true;
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1025,6 +1028,7 @@ const openDrawer = (title: string, row: any) => {
|
|||||||
if(title === '生成')
|
if(title === '生成')
|
||||||
{
|
{
|
||||||
//reportDialogVisible.value = true;
|
//reportDialogVisible.value = true;
|
||||||
|
emit('batchGenerateClicked'); // 触发事件
|
||||||
useDownload(downloadDevData,'调试报告'+formatDate(new Date()), {planId:checkStore.planId,devId:row.id}, false,'.docx')
|
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 === '归档')
|
if (title === '归档')
|
||||||
{
|
{
|
||||||
|
emit('batchGenerateClicked'); // 触发事件
|
||||||
documentedPqDev([row.id])
|
documentedPqDev([row.id])
|
||||||
// const loading = ElLoading.service({
|
// const loading = ElLoading.service({
|
||||||
// lock: true,
|
// lock: true,
|
||||||
@@ -1087,6 +1092,14 @@ onBeforeMount(async () => {
|
|||||||
devChns: item.devChns
|
devChns: item.devChns
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const handleQuitClicked = () => {
|
||||||
|
emit('batchGenerateClicked'); // 触发事件
|
||||||
|
};
|
||||||
|
|
||||||
defineExpose({ changeActiveTabs });
|
defineExpose({ changeActiveTabs });
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -615,6 +615,7 @@ watch(webMsgSend, function (newValue, oldValue) {
|
|||||||
|
|
||||||
}, {deep: true})
|
}, {deep: true})
|
||||||
|
|
||||||
|
|
||||||
// 更新进度条
|
// 更新进度条
|
||||||
const updatePercentage = () => {
|
const updatePercentage = () => {
|
||||||
if (activeIndex < checkTotal) {
|
if (activeIndex < checkTotal) {
|
||||||
@@ -622,7 +623,6 @@ const updatePercentage = () => {
|
|||||||
} else {
|
} else {
|
||||||
percentage.value = 100;
|
percentage.value = 100;
|
||||||
emit('update:testStatus', 'success')
|
emit('update:testStatus', 'success')
|
||||||
|
|
||||||
ElMessageBox.alert('检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测完成', {
|
ElMessageBox.alert('检测全部结束,你可以停留在此页面查看检测结果,或返回首页进行复检、报告生成和归档等操作', '检测完成', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -302,6 +302,8 @@ const handleSubmit = () => {
|
|||||||
sendReCheck()
|
sendReCheck()
|
||||||
|
|
||||||
|
|
||||||
|
}else if (TestStatus.value == 'success') {
|
||||||
|
emit('quitClicked'); // 触发事件
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -312,6 +314,10 @@ const handleSubmit = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'quitClicked'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
watch(preTestStatus, function (newValue, oldValue) {
|
watch(preTestStatus, function (newValue, oldValue) {
|
||||||
console.log(newValue, oldValue);
|
console.log(newValue, oldValue);
|
||||||
|
|
||||||
@@ -481,6 +487,7 @@ const beforeClose = (done: () => void) => {
|
|||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
const handleCancel = () => {
|
const handleCancel = () => {
|
||||||
|
emit('quitClicked'); // 触发事件
|
||||||
// clearData()
|
// clearData()
|
||||||
// emit('update:visible', false); // 关闭对话框
|
// emit('update:visible', false); // 关闭对话框
|
||||||
testRef.value?.clear()
|
testRef.value?.clear()
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
<el-tab-pane :label='tabLabel1' :style='{ height: tabPaneHeight}'>
|
<el-tab-pane :label='tabLabel1' :style='{ height: tabPaneHeight}'>
|
||||||
<!-- 列表数据 -->
|
<!-- 列表数据 -->
|
||||||
<div class='container_table' :style='{ height: tableHeight }'>
|
<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>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
@@ -441,7 +441,11 @@ onUnmounted(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const handleBatchGenerate = () => {
|
||||||
|
console.log('批量生成按钮被点击了');
|
||||||
|
// 在这里添加其他逻辑,比如显示对话框、更新状态等
|
||||||
|
getPieData(currentId.value)
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss' scoped>
|
<style lang='scss' scoped>
|
||||||
|
|
||||||
|
|||||||
@@ -172,15 +172,7 @@ import MonitorTable from '@/views/machine/device/components/monitorTab.vue';
|
|||||||
const MonIsShow = ref(false)
|
const MonIsShow = ref(false)
|
||||||
const DevIsShow = ref(false)
|
const DevIsShow = ref(false)
|
||||||
// 存储设备类型选项
|
// 存储设备类型选项
|
||||||
const devTypeOptions = ref<{
|
const devTypeOptions = ref<Device.ResDev[]>([])
|
||||||
id: string;
|
|
||||||
name: string ,
|
|
||||||
icd:string ,
|
|
||||||
power:string,
|
|
||||||
devVolt:number,
|
|
||||||
devCurr:number,
|
|
||||||
devChns:number,
|
|
||||||
}[]>([])
|
|
||||||
// const IsPasswordShow = ref(false)
|
// const IsPasswordShow = ref(false)
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
const mode = ref()
|
const mode = ref()
|
||||||
@@ -191,24 +183,6 @@ const disabledDate = (time: Date) => {
|
|||||||
return time.getTime() > Date.now()
|
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() {
|
function useMetaInfo() {
|
||||||
const dialogVisible = ref(false)
|
const dialogVisible = ref(false)
|
||||||
const titleType = ref('add')
|
const titleType = ref('add')
|
||||||
@@ -381,8 +355,8 @@ const rules = computed(() => {
|
|||||||
|
|
||||||
|
|
||||||
// 打开弹窗,可能是新增,也可能是编辑
|
// 打开弹窗,可能是新增,也可能是编辑
|
||||||
const open = async (sign: string, data: Device.ResPqDev,currentMode: string,currentScene: string ) => {
|
const open = async (sign: string, data: Device.ResPqDev,currentMode: string,currentScene: string,devType:Device.ResDev[] ) => {
|
||||||
fetchDevTypeOptions()
|
devTypeOptions.value = devType
|
||||||
mode.value = currentMode
|
mode.value = currentMode
|
||||||
scene.value = currentScene
|
scene.value = currentScene
|
||||||
titleType.value = sign
|
titleType.value = sign
|
||||||
@@ -454,7 +428,7 @@ const handleDevTypeChange = (value: string) => {
|
|||||||
|
|
||||||
const handleInput = (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 { ElMessageBox } from 'element-plus'
|
||||||
import { computed, onBeforeMount, onMounted, reactive, ref } from 'vue'
|
import { computed, onBeforeMount, onMounted, reactive, ref } from 'vue'
|
||||||
import { useModeStore , useAppSceneStore} from '@/stores/modules/mode'; // 引入模式 store
|
import { useModeStore , useAppSceneStore} from '@/stores/modules/mode'; // 引入模式 store
|
||||||
import { forEach } from 'lodash'
|
|
||||||
|
|
||||||
const modeStore = useModeStore();
|
const modeStore = useModeStore();
|
||||||
const dictStore = useDictStore()
|
const dictStore = useDictStore()
|
||||||
@@ -51,19 +50,11 @@ const appSceneStore = useAppSceneStore()
|
|||||||
// ProTable 实例
|
// ProTable 实例
|
||||||
const proTable = ref<ProTableInstance>()
|
const proTable = ref<ProTableInstance>()
|
||||||
const devicePopup = ref()
|
const devicePopup = ref()
|
||||||
const ConditionsIsShow = ref(false)
|
|
||||||
|
|
||||||
const boundPqDevList=ref<Device.ReqPqDevParams[]>([])//根据检测计划id查询出所有已绑定的设备
|
const boundPqDevList=ref<Device.ReqPqDevParams[]>([])//根据检测计划id查询出所有已绑定的设备
|
||||||
// 存储设备类型选项
|
// 存储设备类型选项
|
||||||
const devTypeOptions = ref<{
|
const devTypeOptions = ref<Device.ResDev[]>([])
|
||||||
id: string;
|
|
||||||
name: string ,
|
|
||||||
icd:string ,
|
|
||||||
power:string,
|
|
||||||
devVolt:number,
|
|
||||||
devCurr:number,
|
|
||||||
devChns:number,
|
|
||||||
}[]>([])
|
|
||||||
|
|
||||||
const getTableList = async (params: any) => {
|
const getTableList = async (params: any) => {
|
||||||
let newParams = JSON.parse(JSON.stringify(params))
|
let newParams = JSON.parse(JSON.stringify(params))
|
||||||
@@ -158,7 +149,7 @@ const handleDateChange = (startDateTemp: string, endDateTemp: string) => {
|
|||||||
}
|
}
|
||||||
// 打开 drawer(新增、编辑)
|
// 打开 drawer(新增、编辑)
|
||||||
const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
|
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 () => {
|
onBeforeMount(async () => {
|
||||||
const response = await getPqDev()
|
const response = await getPqDev()
|
||||||
devTypeOptions.value = response.data.map(item => ({
|
devTypeOptions.value = (response.data as Device.ResDev[]).map(item => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
icd: item.icd,
|
icd: item.icd,
|
||||||
|
|||||||
Reference in New Issue
Block a user