|
@@ -62,7 +62,7 @@
|
|
|
<span>所属部门:</span>
|
|
<span>所属部门:</span>
|
|
|
<el-cascader
|
|
<el-cascader
|
|
|
v-model="useDeptPath"
|
|
v-model="useDeptPath"
|
|
|
- :options="deptOptions"
|
|
|
|
|
|
|
+ :options="deptTreeList"
|
|
|
:props="deptCascaderProps"
|
|
:props="deptCascaderProps"
|
|
|
:show-all-levels="false"
|
|
:show-all-levels="false"
|
|
|
placeholder="请选择责任部门"
|
|
placeholder="请选择责任部门"
|
|
@@ -127,13 +127,6 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
|
- import {
|
|
|
|
|
- querySpecialEquipmentPage,
|
|
|
|
|
- deleteSpecialEquipment,
|
|
|
|
|
- exportSpecialEquipment,
|
|
|
|
|
- type SpecialEquipment,
|
|
|
|
|
- type SpecialEquipmentQueryParam,
|
|
|
|
|
- } from '@/api/production-safety/special-equipment';
|
|
|
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
|
import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
|
|
import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
@@ -141,50 +134,13 @@
|
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
|
import { TABLE_OPTIONS, SPECIAL_EQUIPMENT_TABLE_COLUMNS } from './configs/tables';
|
|
import { TABLE_OPTIONS, SPECIAL_EQUIPMENT_TABLE_COLUMNS } from './configs/tables';
|
|
|
import { DEVICE_CATEGORY_OPTIONS, Alarm_TYPE_OPTIONS, DEVICE_TYPE, ALARM_TYPE} from './configs/form';
|
|
import { DEVICE_CATEGORY_OPTIONS, Alarm_TYPE_OPTIONS, DEVICE_TYPE, ALARM_TYPE} from './configs/form';
|
|
|
|
|
+ import {type QueryParamType, equipmentHighAlertList, deptList, exportTableData} from '@/api/equipment-high-alert-List'
|
|
|
import { downloadByData } from '@/utils/file/download';
|
|
import { downloadByData } from '@/utils/file/download';
|
|
|
-import { http } from '@/utils/http/axios';
|
|
|
|
|
|
|
+
|
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
|
const dateRange = ref<[string, string] | null>(null);
|
|
const dateRange = ref<[string, string] | null>(null);
|
|
|
- interface QueryParamType {
|
|
|
|
|
- pageNumber: number;
|
|
|
|
|
- pageSize: number;
|
|
|
|
|
- queryParam: {
|
|
|
|
|
- //设备编码
|
|
|
|
|
- deviceNo?: string | undefined;
|
|
|
|
|
- //设备名称
|
|
|
|
|
- deviceName?: string | undefined;
|
|
|
|
|
- // 设备类型
|
|
|
|
|
- deviceType?: string | undefined;
|
|
|
|
|
- // 告警类型
|
|
|
|
|
- alarmType?: string | undefined;
|
|
|
|
|
- // 所属部门
|
|
|
|
|
- deptName?: string | undefined;
|
|
|
|
|
- // 开始时间
|
|
|
|
|
- startTime: string | undefined,
|
|
|
|
|
- // 结束
|
|
|
|
|
- endTime: string | undefined,
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- // 列表数据
|
|
|
|
|
-const equipmentHighAlertList = (query: QueryParamType)=>{
|
|
|
|
|
- return http.request({
|
|
|
|
|
- url: '/prodAlarm/queryProdAlarm',
|
|
|
|
|
- method: 'post',
|
|
|
|
|
- data: query,
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
-// 导出接口
|
|
|
|
|
-const exportTableData = (params)=>{
|
|
|
|
|
- return http.request({
|
|
|
|
|
- url: '/prodAlarm/export',
|
|
|
|
|
- method: 'post',
|
|
|
|
|
- data: params,
|
|
|
|
|
- responseType: 'blob',
|
|
|
|
|
- }, {
|
|
|
|
|
- isTransformResponse: false,
|
|
|
|
|
- });
|
|
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
// BasicTable
|
|
// BasicTable
|
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
@@ -222,7 +178,7 @@ const exportTableData = (params)=>{
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const tableData = ref([]);
|
|
const tableData = ref([]);
|
|
|
-
|
|
|
|
|
|
|
+ const deptTreeList = ref([])
|
|
|
const handleSizeChange = (value: number) => {
|
|
const handleSizeChange = (value: number) => {
|
|
|
pagination.pageSize = value;
|
|
pagination.pageSize = value;
|
|
|
queryParams.pageSize = value;
|
|
queryParams.pageSize = value;
|
|
@@ -236,12 +192,16 @@ const exportTableData = (params)=>{
|
|
|
queryTableList();
|
|
queryTableList();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const getStatusText = (status?: number, statusName?: string) => {
|
|
|
|
|
- if (statusName) return statusName;
|
|
|
|
|
- if (status === 1) return '在用';
|
|
|
|
|
- if (status === 2) return '停用';
|
|
|
|
|
- if (status === 3) return '报废';
|
|
|
|
|
- return '-';
|
|
|
|
|
|
|
+ const getDeptList = async () => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ let res = await deptList()
|
|
|
|
|
+ deptTreeList.value = res.records || []
|
|
|
|
|
+ console.log(res.records)
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ console.error('获取部门树失败:', e);
|
|
|
|
|
+ deptOptions.value = [];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const loadDeptTree = async () => {
|
|
const loadDeptTree = async () => {
|
|
@@ -275,18 +235,11 @@ const exportTableData = (params)=>{
|
|
|
pageSize: queryParams.pageSize,
|
|
pageSize: queryParams.pageSize,
|
|
|
queryParam:{
|
|
queryParam:{
|
|
|
...queryParams.queryParam,
|
|
...queryParams.queryParam,
|
|
|
- startTime: dateRange?.[0]
|
|
|
|
|
- ? dayjs(dateRange?.[0]).format('YYYY-MM-DD')
|
|
|
|
|
- : undefined,
|
|
|
|
|
- endTime: dateRange?.[1]
|
|
|
|
|
- ? dayjs(dateRange?.[1]).format('YYYY-MM-DD')
|
|
|
|
|
- : undefined,
|
|
|
|
|
|
|
+ startTime: dateRange.value?.[0] ?? undefined,
|
|
|
|
|
+ endTime: dateRange.value?.[1] ?? undefined,
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- equipmentHighAlertList({
|
|
|
|
|
- ...queryParams
|
|
|
|
|
-
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ equipmentHighAlertList(data)
|
|
|
.then((res: any) => {
|
|
.then((res: any) => {
|
|
|
tableData.value = res?.records;
|
|
tableData.value = res?.records;
|
|
|
pagination.total = res?.totalRow ?? res?.total ?? 0;
|
|
pagination.total = res?.totalRow ?? res?.total ?? 0;
|
|
@@ -336,6 +289,7 @@ const exportTableData = (params)=>{
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
+ getDeptList()
|
|
|
loadDeptTree();
|
|
loadDeptTree();
|
|
|
queryTableList();
|
|
queryTableList();
|
|
|
});
|
|
});
|