change(dms): 修改DMS 模块的 API调用和界面展示

- 更新 API 调用方式,统一使用 xxxList 方法替代 xxxIn 方法
- 优化界面展示,包括停机时间格式化、设备类型下拉框等
-调整表格列显示、统计信息展示等内容
master
zangchenhao 3 weeks ago
parent c8f7196572
commit 4bc6a063dd

@ -8,7 +8,7 @@ import { ProdBaseMachineInfoVO, ProdBaseMachineInfoForm, ProdBaseMachineInfoQuer
* @returns {*}
*/
export const listDmsBaseMachineInfoIn = (query?: ProdBaseMachineInfoQuery): AxiosPromise<ProdBaseMachineInfoVO[]> => {
export const listDmsBaseMachineInfo = (query?: ProdBaseMachineInfoQuery): AxiosPromise<ProdBaseMachineInfoVO[]> => {
return request({
url: '/dms/dmsBaseMachineInfo/list',
method: 'get',

@ -129,8 +129,8 @@
<script setup name='AlarmType' lang='ts'>
import { listAlarmType, getAlarmType, delAlarmType, addAlarmType, updateAlarmType } from '@/api/dms/alarmType';
import { AlarmTypeVO, AlarmTypeQuery, AlarmTypeForm } from '@/api/dms/alarmType/types';
import { getBaseDeviceCategoryListInDMS } from '@/api/dms/baseDeviceCategory';
import { getBaseDeviceTypeListInDMS } from '@/api/dms/baseDeviceType';
import { getBaseDeviceCategoryList } from '@/api/dms/baseDeviceCategory';
import { getBaseDeviceTypeList } from '@/api/dms/baseDeviceType';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { dms_level_status } = toRefs<any>(proxy?.useDict('dms_level_status'));
@ -155,14 +155,14 @@ const dialog = reactive<DialogOption>({
/** 获取设备大类下拉框 */
const deviceCategoryList = ref([]);
const getBaseDeviceCategoryListSelect = async () => {
let res = await getBaseDeviceCategoryListInDMS(null);
let res = await getBaseDeviceCategoryList(null);
deviceCategoryList.value = res.data;
};
/** 获取设备类型下拉框 */
const deviceTypeList = ref([]);
const getBaseDeviceTypeListSelect = async () => {
let res = await getBaseDeviceTypeListInDMS(null);
let res = await getBaseDeviceTypeList(null);
deviceTypeList.value = res.data;
};

@ -134,7 +134,7 @@
<script setup name="DmsBaseInspectRoute" lang="ts">
import { listDmsBaseInspectRoute, getDmsBaseInspectRoute, delDmsBaseInspectRoute, addDmsBaseInspectRoute, updateDmsBaseInspectRoute } from '@/api/dms/dmsBaseInspectRoute';
import { DmsBaseInspectRouteVO, DmsBaseInspectRouteQuery, DmsBaseInspectRouteForm } from '@/api/dms/dmsBaseInspectRoute/types';
import {getBaseDeviceTypeListInDMS} from "@/api/dms/baseDeviceType";
import {getBaseDeviceTypeList} from "@/api/dms/baseDeviceType";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { inspect_type } = toRefs<any>(proxy?.useDict('inspect_type'));
@ -304,7 +304,7 @@ const handleExport = () => {
let deviceTypeOptions = ref([])
const getDeviceTypeOptions = async () => {
const res = await getBaseDeviceTypeListInDMS(null);
const res = await getBaseDeviceTypeList(null);
deviceTypeOptions.value = res.data;
}

@ -126,7 +126,7 @@
<script setup name="DmsBaseLubeStandard" lang="ts">
import { listDmsBaseLubeStandard, getDmsBaseLubeStandard, delDmsBaseLubeStandard, addDmsBaseLubeStandard, updateDmsBaseLubeStandard } from '@/api/dms/dmsBaseLubeStandard';
import { DmsBaseLubeStandardVO, DmsBaseLubeStandardQuery, DmsBaseLubeStandardForm } from '@/api/dms/dmsBaseLubeStandard/types';
import {getBaseDeviceTypeListInDMS} from "@/api/dms/baseDeviceType";
import {getBaseDeviceTypeList} from "@/api/dms/baseDeviceType";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
@ -301,7 +301,7 @@ const handleExport = () => {
//
let deviceTypeOptions = ref([]);
const getBaseDeviceTypeOption = async () => {
const res = await getBaseDeviceTypeListInDMS(null);
const res = await getBaseDeviceTypeList(null);
deviceTypeOptions.value = res.data;
}

@ -136,7 +136,7 @@
import { listDmsBaseLubeStation, getDmsBaseLubeStation, delDmsBaseLubeStation, addDmsBaseLubeStation, updateDmsBaseLubeStation } from '@/api/dms/dmsBaseLubeStation';
import { DmsBaseLubeStationVO, DmsBaseLubeStationQuery, DmsBaseLubeStationForm } from '@/api/dms/dmsBaseLubeStation/types';
import {getDmsBaseLubeStandardList} from "@/api/dms/dmsBaseLubeStandard";
import {getBaseDeviceTypeListInDMS} from "@/api/dms/baseDeviceType";
import {getBaseDeviceTypeList} from "@/api/dms/baseDeviceType";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
@ -310,7 +310,7 @@ const handleExport = () => {
//
let deviceTypeOptions = ref([]);
const getBaseDeviceTypeOption = async () => {
const res = await getBaseDeviceTypeListInDMS(null);
const res = await getBaseDeviceTypeList(null);
deviceTypeOptions.value = res.data;
}

@ -129,7 +129,7 @@
<script setup name="DmsBaseMaintStandard" lang="ts">
import { listDmsBaseMaintStandard, getDmsBaseMaintStandard, delDmsBaseMaintStandard, addDmsBaseMaintStandard, updateDmsBaseMaintStandard } from '@/api/dms/dmsBaseMaintStandard';
import { DmsBaseMaintStandardVO, DmsBaseMaintStandardQuery, DmsBaseMaintStandardForm } from '@/api/dms/dmsBaseMaintStandard/types';
import {getBaseDeviceTypeListInDMS} from "@/api/dms/baseDeviceType";
import {getBaseDeviceTypeList} from "@/api/dms/baseDeviceType";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
@ -298,7 +298,7 @@ const handleExport = () => {
//
let dviceTypeOptions = ref([]);
const getDviceTypeOption = async () => {
const res = await getBaseDeviceTypeListInDMS(null);
const res = await getBaseDeviceTypeList(null);
dviceTypeOptions.value = res.data;
}

@ -149,7 +149,7 @@
import { listDmsBaseMaintStation, getDmsBaseMaintStation, delDmsBaseMaintStation, addDmsBaseMaintStation, updateDmsBaseMaintStation } from '@/api/dms/dmsBaseMaintStation';
import { DmsBaseMaintStationVO, DmsBaseMaintStationQuery, DmsBaseMaintStationForm } from '@/api/dms/dmsBaseMaintStation/types';
import {getDmsBaseMaintStandardList} from "@/api/dms/dmsBaseMaintStandard";
import {getBaseDeviceTypeListInDMS} from "@/api/dms/baseDeviceType";
import {getBaseDeviceTypeList} from "@/api/dms/baseDeviceType";
import { getDmsBaseMaintProjectList } from '@/api/dms/dmsBaseMaintProject';
@ -332,7 +332,7 @@ const getMaintStandardOtions = async () => {
//
let dviceTypeOptions = ref([]);
const getDviceTypeOption = async () => {
const res = await getBaseDeviceTypeListInDMS(null);
const res = await getBaseDeviceTypeList(null);
dviceTypeOptions.value = res.data;
}

@ -142,7 +142,7 @@
<script setup name="DmsKnowledgeLube" lang="ts">
import { listDmsKnowledgeLube, getDmsKnowledgeLube, delDmsKnowledgeLube, addDmsKnowledgeLube, updateDmsKnowledgeLube } from '@/api/dms/dmsKnowledgeLube';
import { DmsKnowledgeLubeVO, DmsKnowledgeLubeQuery, DmsKnowledgeLubeForm } from '@/api/dms/dmsKnowledgeLube/types';
import {getBaseDeviceTypeListInDMS} from "@/api/dms/baseDeviceType";
import {getBaseDeviceTypeList} from "@/api/dms/baseDeviceType";
import {getDmsBaseLubeStationList} from "@/api/dms/dmsBaseLubeStation";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -320,7 +320,7 @@ const handleExport = () => {
//
let deviceTypeOptions = ref([]);
const getBaseDeviceTypeOption = async () => {
const res = await getBaseDeviceTypeListInDMS(null);
const res = await getBaseDeviceTypeList(null);
deviceTypeOptions.value = res.data;
}

@ -142,7 +142,7 @@
<script setup name="DmsKnowledgeMaint" lang="ts">
import { listDmsKnowledgeMaint, getDmsKnowledgeMaint, delDmsKnowledgeMaint, addDmsKnowledgeMaint, updateDmsKnowledgeMaint } from '@/api/dms/dmsKnowledgeMaint';
import { DmsKnowledgeMaintVO, DmsKnowledgeMaintQuery, DmsKnowledgeMaintForm } from '@/api/dms/dmsKnowledgeMaint/types';
import {getBaseDeviceTypeListInDMS} from "@/api/dms/baseDeviceType";
import {getBaseDeviceTypeList} from "@/api/dms/baseDeviceType";
import {getDmsBaseMaintStationList} from "@/api/dms/dmsBaseMaintStation";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -320,7 +320,7 @@ const handleExport = () => {
//
let deviceTypeOptions = ref([]);
const getBaseDeviceTypeOption = async () => {
const res = await getBaseDeviceTypeListInDMS(null);
const res = await getBaseDeviceTypeList(null);
deviceTypeOptions.value = res.data;
}

@ -133,7 +133,7 @@
<script setup name="DmsKnowledgeRepair" lang="ts">
import { listDmsKnowledgeRepair, getDmsKnowledgeRepair, delDmsKnowledgeRepair, addDmsKnowledgeRepair, updateDmsKnowledgeRepair } from '@/api/dms/dmsKnowledgeRepair';
import { DmsKnowledgeRepairVO, DmsKnowledgeRepairQuery, DmsKnowledgeRepairForm } from '@/api/dms/dmsKnowledgeRepair/types';
import {getBaseDeviceTypeListInDMS} from "@/api/dms/baseDeviceType";
import {getBaseDeviceTypeList} from "@/api/dms/baseDeviceType";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
@ -306,7 +306,7 @@ const handleExport = () => {
//
let deviceTypeOptions = ref([]);
const getBaseDeviceTypeOption = async () => {
const res = await getBaseDeviceTypeListInDMS(null);
const res = await getBaseDeviceTypeList(null);
deviceTypeOptions.value = res.data;
}

@ -58,12 +58,12 @@
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['dms:dmsRecordShutDown:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['dms:dmsRecordShutDown:edit']"></el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['dms:dmsRecordShutDown:add']"></el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['dms:dmsRecordShutDown:edit']"></el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['dms:dmsRecordShutDown:remove']"></el-button>
</el-col>
@ -78,8 +78,8 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="recordShutDownId" v-if="columns[0].visible"/>
<el-table-column label="设备" align="center" prop="machineName" v-if="columns[2].visible"/>
<el-table-column label="停机类型" align="center" prop="shutTypeId" v-if="columns[3].visible"/>
<el-table-column label="停机原因" align="center" prop="shutReasonId" v-if="columns[4].visible"/>
<el-table-column label="停机类型" align="center" prop="shutTypeName" v-if="columns[3].visible"/>
<el-table-column label="停机原因" align="center" prop="shutReasonName" v-if="columns[4].visible"/>
<el-table-column label="停机开始时间" align="center" prop="shutBeginTime" width="180" v-if="columns[5].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.shutBeginTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
@ -90,8 +90,17 @@
<span>{{ parseTime(scope.row.shutEndTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="停机时长(毫秒)" align="center" prop="shutTime" v-if="columns[7].visible"/>
<el-table-column label="停机标识" align="center" prop="downtimeFlag" v-if="columns[8].visible"/>
<!-- <el-table-column label="停机时长(毫秒)" align="center" prop="shutTime" v-if="columns[7].visible"/>-->
<el-table-column label="停机时长" align="center" prop="shutTime" v-if="columns[7].visible">
<template #default="scope">
<span>{{ formatDuration(scope.row.shutTime) }}</span>
</template>
</el-table-column>
<el-table-column label="停机标识" align="center" prop="downtimeFlag" v-if="columns[8].visible">
<template #default="scope">
<dict-tag :options="downtime_flag" :value="scope.row.downtimeFlag"/>
</template>
</el-table-column>
<el-table-column label="停机原因" align="center" prop="shutReason" v-if="columns[9].visible"/>
<el-table-column label="激活标识" align="center" prop="activeFlag" v-if="columns[10].visible">
<template #default="scope">
@ -173,7 +182,14 @@
<el-input v-model="form.shutTime" placeholder="请输入停机时长(毫秒)" />
</el-form-item>
<el-form-item label="停机标识" prop="downtimeFlag">
<el-input v-model="form.downtimeFlag" placeholder="请输入停机标识" />
<!-- <el-input v-model="form.downtimeFlag" placeholder="请输入停机标识" />-->
<el-radio-group v-model="form.downtimeFlag">
<el-radio
v-for="dict in downtime_flag"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-radio-group v-model="form.activeFlag">
@ -206,7 +222,7 @@ import {getDmsBaseShutTypeList} from "@/api/dms/dmsBaseShutType";
import {getDmsBaseShutReasonList} from "@/api/dms/dmsBaseShutReason";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
const { active_flag, downtime_flag } = toRefs<any>(proxy?.useDict('active_flag', 'downtime_flag'));
const dmsRecordShutDownList = ref<DmsRecordShutDownVO[]>([]);
const buttonLoading = ref(false);
@ -231,7 +247,7 @@ const columns = ref<FieldOption[]>([
{ key: 1, label: `租户编号`, visible: false },
{ key: 2, label: `设备`, visible: true },
{ key: 3, label: `停机类型`, visible: true },
{ key: 4, label: `停机原因id`, visible: false },
{ key: 4, label: `停机原因`, visible: true },
{ key: 5, label: `停机开始时间`, visible: true },
{ key: 6, label: `停机结束时间`, visible: true },
{ key: 7, label: `停机时长(毫秒)`, visible: true },
@ -260,6 +276,7 @@ const initFormData: DmsRecordShutDownForm = {
remark: undefined,
machineName: undefined,
shutTypeName: undefined,
shutReasonNameName: undefined,
}
const data = reactive<PageData<DmsRecordShutDownForm, DmsRecordShutDownQuery>>({
@ -279,6 +296,7 @@ const data = reactive<PageData<DmsRecordShutDownForm, DmsRecordShutDownQuery>>({
activeFlag: undefined,
machineName: undefined,
shutTypeName: undefined,
shutReasonNameName: undefined,
params: {
}
},
@ -413,6 +431,14 @@ const handleShutReasonChange = (shutReasonId: number) => {
form.value.shutTypeId = selectedReason?.shutTypeId || ''; //
};
const formatDuration = (millis: number): string => {
if (!millis || millis <= 0) return '0秒'
const hours = Math.floor(millis / 3600000)
const minutes = Math.floor((millis % 3600000) / 60000)
const seconds = Math.floor((millis % 60000) / 1000)
return `${hours ? hours + '小时' : ''}${minutes ? minutes + '分' : ''}${seconds}`
}
onMounted(() => {
getMachineOtions();
getShutTypeOtions();

@ -91,12 +91,12 @@
</el-button>
</el-button-group>
</div>
<div class="toolbar-right">
<el-button type="primary" @click="exportData">
<el-icon><Download /></el-icon>
导出数据
</el-button>
</div>
<!-- <div class="toolbar-right">-->
<!-- <el-button type="primary" @click="exportData">-->
<!-- <el-icon><Download /></el-icon>-->
<!-- 导出数据-->
<!-- </el-button>-->
<!-- </div>-->
</div>
<!-- 查询过滤器 -->
@ -385,15 +385,15 @@
<el-col :span="6">
<el-statistic title="计划保养次数" :value="maintenanceStats.planned" />
</el-col>
<el-col :span="6">
<el-statistic title="临时保养次数" :value="maintenanceStats.temporary" />
</el-col>
<el-col :span="6">
<el-statistic title="平均保养间隔" :value="maintenanceStats.avgInterval" suffix="天" />
</el-col>
<el-col :span="6">
<el-statistic title="下次保养时间" :value="maintenanceStats.nextDate || '未计划'" />
</el-col>
<!-- <el-col :span="6">-->
<!-- <el-statistic title="临时保养次数" :value="maintenanceStats.temporary" />-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-statistic title="平均保养间隔" :value="maintenanceStats.avgInterval" suffix="天" />-->
<!-- </el-col>-->
<!-- <el-col :span="6">-->
<!-- <el-statistic title="下次保养时间" :value="maintenanceStats.nextDate || '未计划'" />-->
<!-- </el-col>-->
</el-row>
</el-card>
</el-col>
@ -408,13 +408,13 @@
<el-table-column prop="maintDate" label="保养日期" />
<el-table-column prop="maintPerson" label="保养人员" />
<el-table-column prop="maintContent" label="保养内容" show-overflow-tooltip />
<el-table-column prop="maintResult" label="保养结果">
<template #default="scope">
<el-tag :type="scope.row.maintResult === '合格' ? 'success' : 'warning'">
{{ scope.row.maintResult }}
</el-tag>
</template>
</el-table-column>
<!-- <el-table-column prop="maintResult" label="保养结果">-->
<!-- <template #default="scope">-->
<!-- <el-tag :type="scope.row.maintResult === '合格' ? 'success' : 'warning'">-->
<!-- {{ scope.row.maintResult }}-->
<!-- </el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</el-card>
</el-col>
@ -426,10 +426,10 @@
</div>
</template>
<script setup name="ProdBaseMachineInfo">
<script setup name="ProdBaseMachineInfo" lang="ts">
import { ref, reactive, toRefs, getCurrentInstance, onMounted, onUnmounted, shallowRef, markRaw, watch } from 'vue';
import { listDmsBaseMachineInfoIn, getDmsBaseMachineInfoList, getDmsBaseMachineInfo } from '@/api/dms/dmsBaseMachineInfo';
import { listBaseDeviceTypeInDMS, getBaseDeviceTypeListInDMS } from '@/api/dms/baseDeviceType';
import { listDmsBaseMachineInfo, getDmsBaseMachineInfoList, getDmsBaseMachineInfo } from '@/api/dms/dmsBaseMachineInfo';
import { listBaseDeviceType, getBaseDeviceTypeList } from '@/api/dms/baseDeviceType';
import { listDmsBaseDevicePurchase, getDmsBaseDevicePurchaseList } from '@/api/dms/dmsBaseDevicePurchase';
import { listDmsBaseDeviceInstall, getDmsBaseDeviceInstallList } from '@/api/dms/dmsBaseDeviceInstall';
import { listDmsBaseDeviceDebugging, getDmsBaseDeviceDebuggingList } from '@/api/dms/dmsBaseDeviceDebugging';
@ -459,8 +459,8 @@ import {
const { proxy } = getCurrentInstance();
// TODO:
const { machine_status, debug_status, fault_status, maint_level, maint_status } = toRefs(proxy.useDict(
'machine_status', 'debug_status', 'fault_status', 'maint_level', 'maint_status'
const { machine_status, debug_status, fault_status, maint_level, maint_status, handle_status, bills_status, active_flag } = toRefs(proxy.useDict(
'machine_status', 'debug_status', 'fault_status', 'maint_level', 'maint_status', 'handle_status', 'bills_status', 'active_flag'
));
// TODO:
// const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
@ -489,7 +489,7 @@ const deviceTypes = ref([]);
//
const queryParams = ref({
pageNum: 1,
pageSize: 12,
pageSize: 10,
machineCode: undefined,
machineName: undefined,
machineLocation: undefined,
@ -618,7 +618,7 @@ const updateCurrentTime = () => {
const getList = async () => {
loading.value = true;
try {
const res = await listDmsBaseMachineInfoIn(queryParams.value);
const res = await listDmsBaseMachineInfo(queryParams.value);
machineList.value = res.rows || [];
total.value = res.total || 0;
@ -635,7 +635,7 @@ const getList = async () => {
//
const getDeviceTypes = async () => {
try {
const res = await getBaseDeviceTypeListInDMS({ pageNum: 1, pageSize: 100 });
const res = await getBaseDeviceTypeList({ pageNum: 1, pageSize: 100 });
deviceTypes.value = res.data;
} catch (error) {
console.error('获取设备类型失败:', error);
@ -1109,10 +1109,10 @@ const viewDetails = async (machine) => {
]);
};
//
const exportData = () => {
proxy.$modal.msgInfo('导出功能开发中...');
};
// //
// const exportData = () => {
// proxy.$modal.msgInfo('...');
// };
//
let timer = null;

Loading…
Cancel
Save