wujingjing
2024-05-17 ea463e94c12fb068f4a2bbcb6d364e3a5ecf955b
ch 编译问题
已添加58个文件
6511 ■■■■■ 文件已修改
src/api/assets/assetsEuipLogic.ts 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/assetsOrg.ts 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/equip/equipPhartMapping.ts 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/equip/equipPhartMappingEx.ts 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/equipment.ts 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/equipmentDirectory.ts 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/equipmentDirectoryContent.ts 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/equipmentGroupManage.ts 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/equipmentGroupStd.ts 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/equipmentManage.ts 136 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/equipmentStd.ts 181 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/supplierManage.ts 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/supplierStd.ts 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/dataDilute.ts 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/dataDocking/configure/dataDockingConfigure.ts 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/dataDocking/configure/item/extensions/configItemExtensions.ts 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/dataDocking/interrupt/dataDockingInterrupt.ts 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/dataProcess.ts 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/dataTransfer.ts 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/day.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/dayStd.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/hourStd.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/inputOnline.ts 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/interrupt/monitorInterruptAlarm.ts 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/list.ts 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/monitorFormula.ts 121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/monitorOrg.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/monitorPointExtensions.ts 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/monitorPointTemplateExtensions.ts 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/monitorPointTemplateStd.ts 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/monitorRecord.ts 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/monitorlAlarm.ts 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/monthStd.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/rangeHistory.ts 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/real.ts 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/signal/signalStd.ts 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/signalAlarm.ts 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/signalStd.ts 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/vibration.ts 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/monitor/yearStd.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/point/monitor/monitorPointStd.ts 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/point/monitor/monitor_point.ts 336 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/point/monitorTemplate/poinTemplate.ts 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/point/signalTemplate/signal.ts 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/run/analyse/runAnalyseConfig.ts 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/run/real/record/runRealRecord.ts 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/run/real/record/runRealRecordStd.ts 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/run/runRealRecord.ts 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/projectCom/basic/catalog/CatalogManageCom.vue 802 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/projectCom/basic/constants.ts 补丁 | 查看 | 原始文档 | blame | 历史
src/projectCom/basic/flag/FlagManageCom.vue 319 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/projectCom/basic/prop/PropManageCom.vue 872 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/projectCom/basic/sys/alarm/level/AlarmLevelCom.vue 234 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/projectCom/basic/sys/alarm/types.ts 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/projectCom/basic/sys/paras/SysParasCom.vue 646 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/projectCom/basic/type/TypeManageCom.vue 531 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/projectCom/basic/types.ts 149 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/projectCom/basic/unit/utils.ts 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/assets/assetsEuipLogic.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–è®¾å¤‡æŠ¥å‘Š
 */
export const GetRunReportRelatedUrl = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Logic/GetRunReportRelatedUrl@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * èŽ·å–è®¾å¤‡æŠ¥å‘Š
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getRunReportRelatedUrl = async (params, req: any = request) => {
    const res = await GetRunReportRelatedUrl(params, req);
    if (res?.Code === 0) {
        const resData = res.Data as any;
        return resData;
    } else {
        ElMessage.error('获取设备报告失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return null;
    }
};
src/api/assets/assetsOrg.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–è®¾å¤‡æˆ–æ³µç«™ï¼ˆå·¥è‰ºå›¾å…³è”ï¼‰
 */
export const GetAssetsOrgFullLogicalTreeListStd = async (req: any = request) => {
    return req({
        url: '/Assets/Org/Logic/GetFullLogicalTreeList@V1.0',
        method: 'GET',
    });
};
/**
 * èŽ·å–è®¾å¤‡æˆ–æ³µç«™ï¼ˆå·¥è‰ºå›¾å…³è”ï¼‰
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getAssetsOrgFullLogicalTreeListStd = async (req: any = request) => {
    const res = await GetAssetsOrgFullLogicalTreeListStd(req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as any[];
        return resData;
    } else {
        ElMessage.error('获取设备目录失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
src/api/assets/equip/equipPhartMapping.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,75 @@
import request from '/@/utils/request';
/**
 * @summary GetAssetsEquipmentPhartMappingByEquipmentID
 */
export const GetAssetsEquipmentPhartMappingByEquipmentID = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Phart/Mapping/GetByEquipmentID@V1.0',
        method: 'get',
        params,
    });
};
/**
 * @summary èŽ·å–æ‰€æœ‰è®¾å¤‡å›¾è¡¨æ˜ å°„
 */
export const GetAllAssetsEquipmentPhartMapping = async (req: any = request) => {
    return req({
        url: '/Assets/Equipment/Phart/Mapping/GetAll@V1.0',
        method: 'get',
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªè®¾å¤‡å›¾è¡¨æ˜ å°„
 */
export const InsertAAssetsEquipmentPhartMapping = async (data, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Phart/Mapping/Insert@V1.0',
        method: 'post',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªè®¾å¤‡å›¾è¡¨æ˜ å°„
 */
export const UpdateAAssetsEquipmentPhartMapping = async (data, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Phart/Mapping/Update@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary ä¿®æ”¹è®¾å¤‡å›¾è¡¨æ˜ å°„排序码
 */
export const UpdateAssetsEquipmentPhartMappingSorter = async (data, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Phart/Mapping/UpdateSorter@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary åˆ é™¤ä¸€ä¸ªè®¾å¤‡å›¾è¡¨æ˜ å°„
 */
export const DeleteAAssetsEquipmentPhartMapping = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Phart/Mapping/DeleteByID@V1.0',
        method: 'delete',
        params,
    });
};
export type EquipmentPhartMapping = {
    ID: string;
    EquipmentID: string;
    DiagramID: string;
    OtherName: string;
    Importance: number;
    SortCode: number;
};
src/api/assets/equip/equipPhartMappingEx.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,106 @@
import type { AxiosInstance } from 'axios';
import type { FeatType } from '/@/projectCom/assets/equipment/pchart/types';
import request from '/@/utils/request';
/**
 * @summary GetAssetsEquipmentPhartMappingExtensionsByEquipmentID
 */
export const GetAssetsEquipmentPhartMappingExtensionsByEquipmentID = (params, req: AxiosInstance = request) => {
    return req({
        url: '/Assets/Equipment/Phart/Mapping/Extensions/GetByEquipmentID@V1.0',
        method: 'get',
        params,
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªè®¾å¤‡å›¾è¡¨æ˜ å°„(extensions)
 */
export const InsertAAssetsEquipmentPhartMappingExtensions = async (data, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Phart/Mapping/Extensions/Insert@V1.0',
        method: 'post',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªè®¾å¤‡å›¾è¡¨æ˜ å°„(extensions)
 */
export const UpdateAAssetsEquipmentPhartMappingExtensions = async (data, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Phart/Mapping/Extensions/Update@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary åˆ é™¤ä¸€ä¸ªè®¾å¤‡å›¾è¡¨æ˜ å°„(extensions)
 */
export const DeleteAAssetsEquipmentPhartMappingExtensions = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Phart/Mapping/Extensions/DeleteByDiagramID@V1.0',
        method: 'delete',
        params,
    });
};
export interface ChartGraph {
    ID: string;
    DiagramID: string;
    Name: string;
    GraphType: number;
    GraphParas: {
        Hz: number;
        N: number;
    };
    GraphInfo: string;
    GeometryStyle: number;
    GeometryParas: {
        FeatType: FeatType;
    };
    GeometryInfo: string;
    DispParas: string;
    ExtraParas: string;
    Paras?: Record<string, unknown>;
    Flags: Record<string, unknown>[];
    SortCode: number;
    Description: string;
}
export type ChartGraphInsert = Omit<PhartDiagram, 'ID' | 'SortCode'>;
export interface PhartDiagram {
    ID: string;
    Name: string;
    NO: string;
    DiagramType: number;
    DiagramParas: string;
    DiagramInfo: string;
    DispParas: string;
    ExtraParas: string;
    Paras?: Record<string, unknown>;
    Flags: Record<string, unknown>[];
    TagName: string;
    SortCode: number;
    Description: string;
    GraphList: ChartGraph[];
}
export type PhartDiagramInsert = Omit<PhartDiagram, 'ID' | 'SortCode'> & {
    GraphList: ChartGraphInsert[];
};
export type EquipPhartMapping = {
    ID: string;
    EquipmentID: string;
    DiagramID: string;
    OtherName: string;
    Importance: number;
    SortCode: number;
    Diagram: PhartDiagram;
};
export type EquipPhartMappingInsert = Omit<EquipPhartMapping, 'ID' | 'SortCode'> & {
    Diagram: PhartDiagramInsert;
};
src/api/assets/equipment.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
import request from '/@/utils/request';
/**
 * @summary é€šè¿‡ID获取设备
 */
export const GetEquipmentByID = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/GetByID@V1.0',
        method: 'GET',
        params: params,
    });
};
src/api/assets/equipmentDirectory.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,67 @@
import request from '/@/utils/request';
/**
 * @summary é€šè¿‡æ³µç«™ ID, èŽ·å–æ‰€æœ‰è®¾å¤‡ç›®å½•
 */
export const GetAllEquipmentDirectoryByID = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Directory/GetByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        data: params,
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªè®¾å¤‡ç›®å½•
 */
export const InsertAEquipmentDirectory = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Directory/Insert@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªè®¾å¤‡ç›®å½•记录
 */
export const UpdateAEquipmentDirectory = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Directory/Update@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary åˆ é™¤ä¸€æ¡è®¾å¤‡ç›®å½•记录
 */
export const DeleteAEquipmentDirectory = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Directory/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
};
/**
 * @summary ä¿®æ”¹è®¾å¤‡ç›®å½•表格排序码
 */
export const UpdateEquipmentDirectorySorter = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Directory/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ£€æŸ¥æ˜¯å¦å·²å­˜åœ¨ç¼–码
 */
export const GetIsExistEquipmentDirectoryTagName = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Directory/IsExistTagName@V1.0',
        method: 'GET',
        params: params,
    });
};
src/api/assets/equipmentDirectoryContent.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
import request from '/@/utils/request';
/**
 * @summary é€šè¿‡ç›®å½• ID,获取目录内容
 */
export const GetContentByDirectoryID = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Directory/Content/GetByDirectoryID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary ä¿å­˜è®¾ç½®çš„目录内容
 */
export const SaveDirectoryContent = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Directory/Content/Save@V1.0',
        method: 'POST',
        data: params,
    });
};
src/api/assets/equipmentGroupManage.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,83 @@
import request from '/@/utils/request';
//#region ====================== è®¾å¤‡ç»„接口 ======================
/**
 * @summary èŽ·å–æ‰€æœ‰è®¾å¤‡ç»„
 */
export const GetAllEquipmentGroup = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Group/GetByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        data: params,
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªè®¾å¤‡ç»„
 */
export const InsertAEquipmentGroup = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Group/Insert@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªè®¾å¤‡ç»„记录
 */
export const UpdateAEquipmentGroup = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Group/Update@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary åˆ é™¤ä¸€æ¡è®¾å¤‡ç»„记录
 */
export const DeleteAEquipmentGroup = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Group/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
};
/**
 * @summary ä¿®æ”¹è®¾å¤‡ç»„表格排序码
 */
export const UpdateEquipmentGroupSorter = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Group/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ›´æ–°æ ‘排序码(更改父级)
 */
export const UpdateEquipmentGroupTreeSortCode = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Group/UpdateTreeSortCode@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ£€æŸ¥æ˜¯å¦å·²å­˜åœ¨æ ‡è®°
 */
export const GetIsExistEquipmentGroupTagName = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Group/IsExistTagName@V1.0',
        method: 'GET',
        params: params,
    });
};
//#endregion
src/api/assets/equipmentGroupStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–è®¾å¤‡ç»„æ ‘ç»“æž„æ•°æ®
 */
export const GetEquipmentGroupTreeDataStd = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Group/Std/GetTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回设备组树结构数据
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getEquipmentGroupTreeDataStd = async (params, req: any = request) => {
    const res = await GetEquipmentGroupTreeDataStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取设备失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
src/api/assets/equipmentManage.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,136 @@
import request from '/@/utils/request';
//#region ====================== è®¾å¤‡æŽ¥å£ ======================
/**
 * @summary èŽ·å–æ‰€æœ‰è®¾å¤‡
 */
export const GetAllEquipment = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Extensions/GetByGroupID@V1.0',
        method: 'GET',
        data: params,
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªè®¾å¤‡
 */
export const InsertAEquipment = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Extensions/Insert@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªè®¾å¤‡è®°å½•
 */
export const UpdateAEquipment = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Extensions/Update@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary åˆ é™¤ä¸€æ¡è®¾å¤‡è®°å½•
 */
export const DeleteAEquipment = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Extensions/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
};
/**
 * @summary ä¿®æ”¹è®¾å¤‡è¡¨æ ¼æŽ’序码
 */
export const UpdateEquipmentSorter = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ›´æ–°æ ‘排序码(更改父级)
 */
export const UpdateEquipmentTreeSortCode = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/UpdateTreeSortCode@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ£€æŸ¥æ˜¯å¦å·²å­˜åœ¨æ ‡è®°
 */
export const GetIsExistEquipmentTagName = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/IsExistTagName@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ›´æ–°è®¾å¤‡ä½¿ç”¨çŠ¶æ€
 */
export const UpdateEquipmentUseStatus = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/UpdateUseStatus@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary é€šè¿‡ catalogID èŽ·å–å±žæ€§
 */
export const GetPropertyByCatalogID = async (params, req: any = request) => {
    return req({
        url: '/Basic/Sys/Prop/Struct/GetByCatalogID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary é€šè¿‡çˆ¶çº§åˆ†ç±» ID,获取当前可选分类(剔除掉下层分类)
 */
export const GetAuthorityCatalogByCatalogID = async (params, req: any = request) => {
    return req({
        url: '/Basic/Sys/Catalog/Authority/GetByParentID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary é€šè¿‡ equipmentID èŽ·å–æ˜ å°„æµ‹ç‚¹
 */
export const GetMonitorPointByEquipmentID = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Monitor/Mapping/GetByEquipmentID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary è®¾ç½®è®¾å¤‡æ˜ å°„的测点
 */
export const SetEquipmentMapMonitorPoint = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Monitor/Mapping/Set@V1.0',
        method: 'POST',
        data: params,
    });
};
//#endregion
src/api/assets/equipmentStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,181 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æœºç»„
 */
export const GetByBelongTypeAndBelongID = async (params, req: any = request) => {
    return req({
        url: '/Assets/EnginePump/Logic/GetByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * @summary èŽ·å–Catalog è¿‡æ»¤èŽ·å–æœºç»„
 */
export const GetCatalogTreeListByBelongTypeAndBelongID = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Std/GetCatalogTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * @summary èŽ·å–è®¾å¤‡æ ‘ç»“æž„æ•°æ®
 */
export const GetEquipmentTreeDataStd = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Std/GetTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回设备树结构数据
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getEquipmentTreeDataStd = async (params, req: any = request) => {
    const res = await GetEquipmentTreeDataStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取设备失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
/**
 * @summary èŽ·å–æ‰€æœ‰è®¾å¤‡ï¼ˆéžæ ‘ç»“æž„ï¼‰
 */
export const GetEquipmentListStd = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Std/GetTreeItemListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回所有设备(非树结构)
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getEquipmentListStd = async (params, req: any = request) => {
    const res = await GetEquipmentListStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取所有设备失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
/**
 * @summary èŽ·å–è®¾å¤‡æ ‘ï¼Œé€šè¿‡ GroupID
 */
export const GetEquipmentTreeDataByGroupIDStd = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Std/GetTreeListByGroupID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回设备树,通过 GroupID
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getEquipmentTreeDataByGroupIDStd = async (params, req: any = request) => {
    const res = await GetEquipmentTreeDataByGroupIDStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取设备树失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
/**
 * @summary èŽ·å–è®¾å¤‡
 */
export const GetMainTreeListByBelongTypeAndBelongIDStd = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Std/GetMainTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回设备(过滤掉 CatalogID ä¸º '0')的情况
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getMainTreeListByBelongTypeAndBelongIDStd = async (params, req: any = request) => {
    const res = await GetMainTreeListByBelongTypeAndBelongIDStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取设备失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
/**
 * @summary é€šè¿‡belongType,belongID å’Œ åˆ†ç±»ç¼–码获取设备
 */
export const GetCatalogTreeItemListByBelongTypeAndBelongIDStd = async (params, req: any = request) => {
    return req({
        url: '/Assets/Equipment/Std/GetCatalogListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œé€šè¿‡belongType,belongID å’Œ åˆ†ç±»ç¼–码获取设备
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getCatalogTreeItemListByBelongTypeAndBelongIDStd = async (params, req: any = request) => {
    const res = await GetCatalogTreeItemListByBelongTypeAndBelongIDStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取设备失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
export interface MainEquipTree {
    ID: string;
    ParentID: string;
    GroupID: string;
    Name: string;
    NO: string;
    CatalogID: string;
    ModelType: string;
    Specification: string;
    SupplierID: string;
    Paras?: Record<string, unknown>;
    Flags: string[];
    TagName: string;
    SortCode: number;
    Description: string;
    Children: MainEquipTree[];
}
src/api/assets/supplierManage.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,77 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æ‰€æœ‰åŽ‚å•†
 */
export const GetAllSupplier = async (req: any = request) => {
    return req({
        url: '/Assets/Supplier/GetAll@V1.0',
        method: 'GET',
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªåŽ‚å•†
 */
export const InsertASupplier = async (params, req: any = request) => {
    return req({
        url: '/Assets/Supplier/Insert@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªåŽ‚å•†è®°å½•
 */
export const UpdateASupplier = async (params, req: any = request) => {
    return req({
        url: '/Assets/Supplier/Update@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary åˆ é™¤ä¸€æ¡åŽ‚å•†è®°å½•
 */
export const DeleteASupplier = async (params, req: any = request) => {
    return req({
        url: '/Assets/Supplier/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
};
/**
 * @summary ä¿®æ”¹åŽ‚å•†è¡¨æ ¼æŽ’åºç 
 */
export const UpdateSupplierSorter = async (params, req: any = request) => {
    return req({
        url: '/Assets/Supplier/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ£€æŸ¥æ˜¯å¦å·²å­˜åœ¨æ ‡ç­¾åç§°
 */
export const GetIsExistTagName = async (params, req: any = request) => {
    return req({
        url: '/Assets/Supplier/IsExistTagName@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ›´æ–°åŽ‚å•†çš„ä½¿ç”¨çŠ¶æ€
 */
export const UpdateSupplierUseStatus = async (params, req: any = request) => {
    return req({
        url: '/Assets/Supplier/UpdateUseStatus@V1.0',
        method: 'PUT',
        data: params,
    });
};
src/api/assets/supplierStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–åŽ‚å•†é€‰æ‹©åˆ—è¡¨
 */
export const GetSupplierSelectListStd = async (req: any = request) => {
    return req({
        url: '/Assets/Supplier/Std/GetSelectList@V1.0',
        method: 'GET',
    });
};
/**
 * è¿”回厂商列表
 * @returns
 */
export const getSupplierSelectList = async (req: any = request) => {
    const res = await GetSupplierSelectListStd(req);
    if (res?.Code === 0) {
        return res.Data || [];
    } else {
        ElMessage.error('获取厂商列表失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
src/api/monitor/dataDilute.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æ‰€æœ‰ç›‘æµ‹ç¨€é‡Šæ“ä½œ
 */
export const GetAllMonitorDiluteOpsLevel = async (req: any = request) => {
    return req({
        url: '/Monitor/Dilute/Ops/GetAll@V1.0',
        method: 'get',
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªç›‘æµ‹ç¨€é‡Šæ“ä½œ
 */
export const InsertAMonitorDiluteOpsLevel = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Dilute/Ops/Insert@V1.0',
        method: 'post',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªç›‘测稀释操作
 */
export const UpdateAMonitorDiluteOpsLevel = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Dilute/Ops/Update@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ç›‘测稀释操作排序码
 */
export const UpdateMonitorDiluteOpsLevelSorter = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Dilute/Ops/UpdateSorter@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary åˆ é™¤ä¸€ä¸ªç›‘测稀释操作
 */
export const DeleteAMonitorDiluteOpsLevel = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Dilute/Ops/DeleteByID@V1.0',
        method: 'delete',
        params,
    });
};
/**
 *
 * @summary è®¾ç½® â˜…更新方法的状态
 */
export async function UpdateUseStatus(params, req: any = request) {
    return req({
        url: '/Monitor/Dilute/Ops/UpdateUseStatus@V1.0',
        method: 'PUT',
        data: params,
    });
}
src/api/monitor/dataDocking/configure/dataDockingConfigure.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,87 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æ‰€æœ‰æ•°æ®å¯¹æŽ¥é…ç½®
 */
export const GetAllMonitorDataDockingConfigure = async (req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Configure/GetAll@V1.0',
        method: 'get',
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªæ•°æ®å¯¹æŽ¥é…ç½®
 */
export const InsertAMonitorDataDockingConfigure = async (data, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Configure/Insert@V1.0',
        method: 'post',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªæ•°æ®å¯¹æŽ¥é…ç½®
 */
export const UpdateAMonitorDataDockingConfigure = async (data, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Configure/Update@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary ä¿®æ”¹æ•°æ®å¯¹æŽ¥é…ç½®æŽ’序码
 */
export const UpdateMonitorDataDockingConfigureSorter = async (data, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Configure/UpdateSorter@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary æ›´æ–°æ•°æ®å¯¹æŽ¥é…ç½®ä½¿ç”¨çŠ¶æ€
 */
export const UpdateMonitorDataDockingConfigureUseStatus = async (data, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Configure/UpdateUseStatus@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary æ£€æŸ¥æ˜¯å¦å·²å­˜åœ¨æ ‡è®°
 */
export const GetIsExistMonitorDataDockingConfigureTagName = async (params, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Configure/IsExistTagName@V1.0',
        method: 'get',
        params,
    });
};
/**
 * @summary åˆ é™¤ä¸€ä¸ªæ•°æ®å¯¹æŽ¥é…ç½®
 */
export const DeleteAMonitorDataDockingConfigure = async (params, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Configure/DeleteByID@V1.0',
        method: 'delete',
        params,
    });
};
/**
 * @summary é€šè¿‡ ID èŽ·å–æ•°æ®å¯¹æŽ¥é…ç½®
 */
export const GetMonitorDataDockingConfigureByID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Configure/GetByID@V1.0',
        method: 'get',
        params,
    });
};
src/api/monitor/dataDocking/configure/item/extensions/configItemExtensions.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,12 @@
import request from '/@/utils/request';
/**
 * @summary é€šè¿‡ ConfigureID èŽ·å–å¯¹æŽ¥é…ç½®é¡¹
 */
 export const GetDataDockingConfigureItemExtensionsByConfigureID = async (params,req:any=request) => {
    return req({
        url: '/Monitor/DataDocking/Configure/Item/Extensions/GetByConfigureID@V1.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/dataDocking/interrupt/dataDockingInterrupt.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
import request from '/@/utils/request';
/**
 * @summary GetMonitorDataDockingInterruptAlarmConfigureByDataDockingID
 */
export const GetMonitorDataDockingInterruptAlarmConfigureByDataDockingID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Interrupt/Alarm/Configure/GetByDataDockingID@V1.0',
        method: 'get',
        params,
    });
};
/**
 * @summary èŽ·å–æ‰€æœ‰æ•°æ®å¯¹æŽ¥ä¸­æ–­æŠ¥è­¦é…ç½®
 */
export const GetAllMonitorDataDockingInterruptAlarmConfigure = async (params, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Interrupt/Alarm/Configure/GetByDataDockingID@V1.0',
        method: 'get',
        params,
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªæ•°æ®å¯¹æŽ¥ä¸­æ–­æŠ¥è­¦é…ç½®
 */
export const InsertAMonitorDataDockingInterruptAlarmConfigure = async (data, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Interrupt/Alarm/Configure/Insert@V1.0',
        method: 'post',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªæ•°æ®å¯¹æŽ¥ä¸­æ–­æŠ¥è­¦é…ç½®
 */
export const UpdateAMonitorDataDockingInterruptAlarmConfigure = async (data, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Interrupt/Alarm/Configure/Update@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary ä¿®æ”¹æ•°æ®å¯¹æŽ¥ä¸­æ–­æŠ¥è­¦é…ç½®æŽ’序码
 */
export const UpdateMonitorDataDockingInterruptAlarmConfigureSorter = async (data, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Interrupt/Alarm/Configure/UpdateSorter@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary æ›´æ–°æ•°æ®å¯¹æŽ¥ä¸­æ–­æŠ¥è­¦é…ç½®ä½¿ç”¨çŠ¶æ€
 */
export const UpdateMonitorDataDockingInterruptAlarmConfigureUseStatus = async (data, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Interrupt/Alarm/Configure/UpdateUseStatus@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary åˆ é™¤ä¸€ä¸ªæ•°æ®å¯¹æŽ¥ä¸­æ–­æŠ¥è­¦é…ç½®
 */
export const DeleteAMonitorDataDockingInterruptAlarmConfigure = async (params, req: any = request) => {
    return req({
        url: '/Monitor/DataDocking/Interrupt/Alarm/Configure/DeleteByID@V1.0',
        method: 'delete',
        params,
    });
};
src/api/monitor/dataProcess.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æ‰€æœ‰ç›‘æµ‹åˆ é™¤æ“ä½œ
 */
export const GetAllMonitorDeleteOpsLevel = async (req: any = request) => {
    return req({
        url: '/Monitor/Delete/Ops/GetAll@V1.0',
        method: 'get',
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªç›‘æµ‹åˆ é™¤æ“ä½œ
 */
export const InsertAMonitorDeleteOpsLevel = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Delete/Ops/Insert@V1.0',
        method: 'post',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªç›‘测删除操作
 */
export const UpdateAMonitorDeleteOpsLevel = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Delete/Ops/Update@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ç›‘测删除操作排序码
 */
export const UpdateMonitorDeleteOpsLevelSorter = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Delete/Ops/UpdateSorter@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary åˆ é™¤ä¸€ä¸ªç›‘测删除操作
 */
export const DeleteAMonitorDeleteOpsLevel = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Delete/Ops/DeleteByID@V1.0',
        method: 'delete',
        params,
    });
};
/**
 *
 * @summary è®¾ç½® â˜…更新方法的状态
 */
export async function UpdateUseStatus(params, req: any = request) {
    return req({
        url: '/Monitor/Delete/Ops/UpdateUseStatus@V1.0',
        method: 'PUT',
        data: params,
    });
}
src/api/monitor/dataTransfer.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æ‰€æœ‰ç›‘æµ‹ç¨€é‡Šæ“ä½œ
 */
export const GetAllMonitorTransferOpsLevel = async (req: any = request) => {
    return req({
        url: '/Monitor/Transfer/Ops/GetAll@V1.0',
        method: 'get',
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªç›‘æµ‹ç¨€é‡Šæ“ä½œ
 */
export const InsertAMonitorTransferOpsLevel = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Transfer/Ops/Insert@V1.0',
        method: 'post',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªç›‘测稀释操作
 */
export const UpdateAMonitorTransferOpsLevel = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Transfer/Ops/Update@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ç›‘测稀释操作排序码
 */
export const UpdateMonitorTransferOpsLevelSorter = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Transfer/Ops/UpdateSorter@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary åˆ é™¤ä¸€ä¸ªç›‘测稀释操作
 */
export const DeleteAMonitorTransferOpsLevel = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Transfer/Ops/DeleteByID@V1.0',
        method: 'delete',
        params,
    });
};
/**
 *
 * @summary è®¾ç½® â˜…更新方法的状态
 */
export async function UpdateUseStatus(params, req: any = request) {
    return req({
        url: '/Monitor/Transfer/Ops/UpdateUseStatus@V1.0',
        method: 'PUT',
        data: params,
    });
}
src/api/monitor/day.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–ä¿¡å·ç»„
 */
export const GetSimpleLogicalTreeListByBelongTypeAndBelongID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/Std/GetSimpleLogicalTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/dayStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
import request from '/@/utils/request';
/**
 * @summary é€šè¿‡ä¿¡å·ID获取日期区间的数据值
 */
export const GetBySignalIDOfDayRange = async (params) => {
    return request({
        url: '/Monitor/Record/Day/Std/GetBySignalIDOfDayRange@V2.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/hourStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
import request from '/@/utils/request';
/**
 * @summary é€šè¿‡ä¿¡å·ID获取时的数据值
 */
export const GetBySignalIDOfDay = async (params) => {
    return request({
        url: '/Monitor/Record/Hour/Std/GetBySignalIDOfDay@V2.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/inputOnline.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
import request from '/@/utils/request';
/**
 * @summary æ ¹æ®æµ‹ç‚¹ç»„çš„ID获取信号列表
 */
export const GetByGroupID = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Input/Online/Logic/GetByGroupID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary å¤šä¸ªä¿¡å·çš„æ‰‹åŠ¨è¾“å…¥å€¼
 */
export const InputsLastRecord = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Input/Online/Logic/InputsLastRecord@V1.0',
        method: 'POST',
        data: params,
    });
};
src/api/monitor/interrupt/monitorInterruptAlarm.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
import request from '/@/utils/request';
/**
 * @summary GetMonitorInterruptAlarmConfigureByMonitorPointID
 */
export const GetMonitorInterruptAlarmConfigureByMonitorPointID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Interrupt/Alarm/Configure/GetByMonitorPointID@V1.0',
        method: 'get',
        params,
    });
};
/**
 * @summary èŽ·å–æ‰€æœ‰æµ‹ç‚¹ä¸­æ–­æŠ¥è­¦é…ç½®
 */
export const GetAllMonitorInterruptAlarmConfigure = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Interrupt/Alarm/Configure/GetByMonitorPointID@V1.0',
        method: 'get',
        params,
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªæµ‹ç‚¹ä¸­æ–­æŠ¥è­¦é…ç½®
 */
export const InsertAMonitorInterruptAlarmConfigure = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Interrupt/Alarm/Configure/Insert@V1.0',
        method: 'post',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªæµ‹ç‚¹ä¸­æ–­æŠ¥è­¦é…ç½®
 */
export const UpdateAMonitorInterruptAlarmConfigure = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Interrupt/Alarm/Configure/Update@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary ä¿®æ”¹æµ‹ç‚¹ä¸­æ–­æŠ¥è­¦é…ç½®æŽ’序码
 */
export const UpdateMonitorInterruptAlarmConfigureSorter = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Interrupt/Alarm/Configure/UpdateSorter@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary æ›´æ–°æµ‹ç‚¹ä¸­æ–­æŠ¥è­¦é…ç½®ä½¿ç”¨çŠ¶æ€
 */
export const UpdateMonitorInterruptAlarmConfigureUseStatus = async (data, req: any = request) => {
    return req({
        url: '/Monitor/Interrupt/Alarm/Configure/UpdateUseStatus@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary åˆ é™¤ä¸€ä¸ªæµ‹ç‚¹ä¸­æ–­æŠ¥è­¦é…ç½®
 */
export const DeleteAMonitorInterruptAlarmConfigure = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Interrupt/Alarm/Configure/DeleteByID@V1.0',
        method: 'delete',
        params,
    });
};
src/api/monitor/list.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,96 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æµ‹ç‚¹åˆ—è¡¨
 */
export const GetByGroupID = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Last/List/Logic/GetByGroupID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary åˆ·æ–°ä¸€æ¡æµ‹ç‚¹åˆ—表数据
 */
export const GetLastRecord = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Last/List/Logic/GetLastRecord@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ£’图数据
 */
export const GetByBarGroupID = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Bar/GetByGroupID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary åˆ·æ–°æ£’图数据
 */
export const GetBarLastRecord = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Bar/GetLastRecord@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary èŽ·å–format类型
 */
export const GetDisplayParasByID = async (params) => {
    return request({
        url: '/Monitor/Signal/Std/GetDisplayParasByID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ ¹æ®ä¿¡å·ID获取图表数据(有文本和其他图表)
 */
export const GetBySignalIDOfDay = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Std/GetBySignalIDOfDay@V2.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ ¹æ®ä¿¡å·ID获取图表数据 (只有图表)
 */
export const GetBySignalIDOfNumberDay = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Std/GetBySignalIDOfDay@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ ¹æ®ä¿¡å·ID实时刷新图表数据
 */
export const GetEChartLastRecord = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Std/GetLastRecord@V2.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ ¹æ®ä¿¡å·ID获取计量参数
 */
export const GetMeasureParasByID = async (params) => {
    return request({
        url: '/Monitor/Signal/Std/GetMeasureParasByID@V1.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/monitorFormula.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,121 @@
import request from '/@/utils/request';
//#region ====================== å·¦ä¾§æ ‘列表 ======================
/**
 *
 * @summary
 */
export async function GetAll(req: any = request) {
    return req({
        url: '/Monitor/Formula/Group/GetAll@V1.0',
        method: 'GET',
    });
}
//插入一条
export async function InsertGetByID(params, req: any = request) {
    return req({
        url: '/Monitor/Formula/Group/Insert@V1.0',
        method: 'POST',
        data: params,
    });
}
//更新一条
export async function UpdateGetByID(params, req: any = request) {
    return req({
        url: '/Monitor/Formula/Group/Update@V1.0',
        method: 'PUT',
        data: params,
    });
}
//删除一条
export async function DeleteGetByID(params, req: any = request) {
    return req({
        url: '/Monitor/Formula/Group/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
}
/**
 * @summary æ›´æ–°ç”¨æˆ·æŽ’序码
 */
export const UpdateUserSorter = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Formula/Group/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ›´æ–°æ ‘排序码(更改父级)
 */
export const UpdateFormulaGroupTreeSortCode = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Formula/Group/UpdateTreeSortCode@V1.0',
        method: 'PUT',
        data: params,
    });
};
//根据组获取列表
export async function GetByGroupID(params, req: any = request) {
    return req({
        url: '/Monitor/Formula/GetByGroupID@V1.0',
        method: 'GET',
        params: params,
    });
}
//#endregion
//#region ====================== å³ä¾§è¡¨æ ¼åˆ—表 ======================
//插入一条
export async function TableInsert(params, req: any = request) {
    return req({
        url: '/Monitor/Formula/Insert@V1.0',
        method: 'POST',
        data: params,
    });
}
//更新一条
export async function TableUpdate(params, req: any = request) {
    return req({
        url: '/Monitor/Formula/Update@V1.0',
        method: 'PUT',
        data: params,
    });
}
//删除
export async function TableDelete(params, req: any = request) {
    return req({
        url: '/Monitor/Formula/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
}
//#endregion
/**
 * @summary æ˜¯å¦å·²å­˜åœ¨å½“前编码
 */
export const GetIsExistFormulaCode = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Formula/IsExistCode@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ›´æ–°å…¬å¼æŽ’序码
 */
export const UpdateFormulaSorter = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Formula/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
src/api/monitor/monitorOrg.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æ‰€æœ‰ä¿¡å·æ ‘ï¼ˆå·¥è‰ºå›¾ç»˜åˆ¶å·¦ä¾§æ ‘ï¼‰
 */
export const GetFullLogicalTreeList = async (req = request) => {
    return req({
        url: '/Monitor/Org/Logic/GetFullLogicalTreeList@V1.0',
        method: 'GET',
    });
};
src/api/monitor/monitorPointExtensions.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,45 @@
import request from '/@/utils/request';
/**
 * @summary æ’入一个监测点(扩展)
 */
export const InsertMonitorPointExtensions = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Extensions/Insert@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary æ’入多个监测点(扩展
 */
export const InsertBulkMonitorPointExtensions = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Extensions/Inserts@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary  é€šè¿‡ä¸€ç»„ id èŽ·å–æµ‹ç‚¹ï¼ˆæ‹“å±•ï¼‰
 */
export const GetPointExtensionByIds = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Extensions/GetByIds@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary é€šè¿‡BelongType和BelongID èŽ·å–æ‰€æœ‰æµ‹ç‚¹
 */
export const GetPointExtensionsByBelongTypeAndBelongID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Extensions/GetByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/monitorPointTemplateExtensions.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
import request from '/@/utils/request';
/**
 * @summary æ’入一条信号模板(扩展)
 */
export const InsertAMonitorPointTemplate = async (params) => {
  return request({
    url: "/Monitor/Point/Template/Extensions/Insert@V1.0",
    method: "POST",
    data: params,
  });
};
src/api/monitor/monitorPointTemplateStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–ç›‘æµ‹ç‚¹æ¨¡æ¿
 */
export const GetMonitorPointTemplateSelectListStd = async (req: any = request) => {
    return req({
        url: '/Monitor/Point/Template/Std/GetSelectList@V1.0',
        method: 'GET',
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回监测点模板
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getMonitorPointTemplateSelectListStd = async (req: any = request) => {
    const res = await GetMonitorPointTemplateSelectListStd(req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取监测点模板失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
src/api/monitor/monitorRecord.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,57 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æœ€è¿‘ä¸€æ¡è®°å½•
 */
export const GetLastRecord = async (params, req = request) => {
    return req({
        url: '/Monitor/Record/Std/GetLastRecord@V2.0',
        method: 'GET',
        params: params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回最近一个测点的记录
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getLastRecordStd = async (params, req: any = request) => {
    const res = await GetLastRecord(params, req);
    if (res?.Code === 0) {
        const resData = res.Data as any;
        return resData;
    } else {
        ElMessage.error('获取测点记录失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
/**
 * @summary èŽ·å–æœ€è¿‘çš„å¤šä¸ªæµ‹ç‚¹çš„è®°å½•
 */
export const GetLastRecordListStd = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Record/Std/GetLastRecordList@V2.0',
        method: 'GET',
        params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回最近的多个测点的记录
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getLastRecordListStd = async (params, req: any = request) => {
    const res = await GetLastRecordListStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as any[];
        return resData;
    } else {
        ElMessage.error('获取测点记录失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
src/api/monitor/monitorlAlarm.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,44 @@
import request from '/@/utils/request';
/**
 * @summary ç›‘测值最近报警几条记录
 */
export const GetLastList = async (params) => {
    return request({
        url: '/Monitor/Value/Alarm/Record/Std/GetLastList@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary ç›‘测值报警记录
 */
export const GetPageListByGroupIDContainsChildren = async (params) => {
    return request({
        url: '/Monitor/Value/Alarm/Record/Std/GetPageListByGroupIDContainsChildren@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary èŽ·å–ä¸­æ–­æŠ¥è­¦åˆ†é¡µåˆ—è¡¨
 */
export const GetAlarmPageList = async (params) => {
    return request({
        url: '/Monitor/Interrupt/Alarm/Record/Std/GetPageListByGroupIDContainsChildren@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary èŽ·å–å¯¹æŽ¥æŠ¥è­¦åˆ—è¡¨
 */
export const GetDataDockPageList = async (params) => {
    return request({
        url: '/Monitor/DataDocking/Interrupt/Alarm/Record/Std/GetPageList@V1.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/monthStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
import request from '/@/utils/request';
/**
 * @summary é€šè¿‡ä¿¡å·ID获取月区间的数据值
 */
export const GetBySignalIDOfMonthRange = async (params) => {
    return request({
        url: '/Monitor/Record/Month/Std/GetBySignalIDOfMonthRange@V2.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/rangeHistory.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
import request from '/@/utils/request';
/**
 * @summary  åŒºé—´æŸ¥è¯¢  æ˜¾ç¤ºæ ¼å¼ç±»åž‹
 */
export const GetDisplayParasByID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/Std/GetDisplayParasByID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary  åŒºé—´æŸ¥è¯¢  æš‚时还未掉接口 éœ€è¦ç”¨åœ¨EchartData图表里
 */
export const GetLimitBySignalIDOfTimeRange = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Record/Real/Std/GetLimitBySignalIDOfTimeRange@V2.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/real.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,85 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æµ‹ç‚¹ç»„åˆ—è¡¨
 */
export const GetLogicalTreeListByBelongTypeAndBelongID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Record/Real/Vibration/Logic/GetLogicalTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary èŽ·å–è®¾å¤‡åˆ—è¡¨
 */
export const GetEquipmentLogicalTreeListByBelongTypeAndBelongID = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Vibration/Logic/GetEquipmentLogicalTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ ¹æ®æµ‹ç‚¹åˆ—表或者信号下拉选择
 */
export const GetSimpleSignalListByMonitorPointID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Record/Real/Vibration/Logic/GetSimpleSignalListByMonitorPointID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary
 */
export const GetLastRecordList = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Record/Real/Vibration/Logic/GetSimpleLastRecordBySignalIds@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ³¢å½¢å›¾
 */
export const GetLastWaveSpectrumByMonitorPointID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Record/Real/Vibration/Logic/GetLastWaveSpectrumByMonitorPointID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary é¢‘谱图
 */
export const GetLastFrequencySpectrumByMonitorPointID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Record/Real/Vibration/Logic/GetLastFrequencySpectrumByMonitorPointID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ³¢å½¢é¢‘谱图
 */
export const GetLastWaveAndFrequencySpectrumByMonitorPointID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Record/Real/Vibration/Logic/GetLastWaveAndFrequencySpectrumByMonitorPointID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ•…障频率分析
 */
export const GetLastDegreeFrequencySpectrumByMonitorPointID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Record/Real/Vibration/Logic/GetLastDegreeFrequencySpectrumByMonitorPointID@V1.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/signal/signalStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,29 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–é…ç½®è¡¨æ ¼
 */
export const GetMonitorSignalDockingLogicalTreeListByBelongTypeAndBelongID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/Std/GetDockingLogicalTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * èŽ·å–é…ç½®è¡¨æ ¼
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getMonitorSignalDockingLogicalTreeListByBelongTypeAndBelongID = async (params, req: any = request) => {
    const res = await GetMonitorSignalDockingLogicalTreeListByBelongTypeAndBelongID(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as any[];
        return resData;
    } else {
        ElMessage.error('获取信号失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return [];
    }
};
src/api/monitor/signalAlarm.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,66 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æ‰€æœ‰æŠ¥è­¦é…ç½®
 */
export const GetAllSignalAlarm = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Value/Alarm/Configure/GetBySignalID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªæŠ¥è­¦é…ç½®
 */
export const InsertASignalAlarm = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Value/Alarm/Configure/Insert@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªæŠ¥è­¦é…ç½®è®°å½•
 */
export const UpdateASignalAlarm = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Value/Alarm/Configure/Update@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary åˆ é™¤ä¸€æ¡æŠ¥è­¦é…ç½®è®°å½•
 */
export const DeleteASignalAlarm = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Value/Alarm/Configure/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
};
/**
 * @summary ä¿®æ”¹æŠ¥è­¦é…ç½®è¡¨æ ¼æŽ’序码
 */
export const UpdateSignalAlarmSorter = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Value/Alarm/Configure/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ›´æ–°æŠ¥è­¦é…ç½®ä½¿ç”¨çŠ¶æ€
 */
export const UpdateSignalAlarmUseStatus = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Value/Alarm/Configure/UpdateUseStatus@V1.0',
        method: 'PUT',
        data: params,
    });
};
src/api/monitor/signalStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,86 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–ä¿¡å·æ ‘
 */
export const GetNumericSignalLogicalTreeStd = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/Std/GetSimpleLogicalTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回数值型的信号树
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getNumericSignalLogicalTreeStd = async (params, req: any = request) => {
    const res = await GetNumericSignalLogicalTreeStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取信号树失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
/**
 * @summary èŽ·å–ä¿¡å·æ ‘
 */
export const GetSignalLogicalTreeStd = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/Std/GetLogicalTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回信号树(完整)
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getSignalLogicalTreeStd = async (params, req: any = request) => {
    const res = await GetSignalLogicalTreeStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取信号树失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
/**
 * @summary èŽ·å–ä¿¡å·æ ‘ï¼ˆå¯ä»¥æŒ‡å®šæ ¼å¼ï¼‰
 */
export const GetFormatLogicalTreeStd = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/Std/GetFormatLogicalTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回信号树
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getFormatLogicalTreeStd = async (params, req: any = request) => {
    const res = await GetFormatLogicalTreeStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取信号树失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
src/api/monitor/vibration.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,85 @@
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æµ‹ç‚¹ç»„åˆ—è¡¨
 */
export const GetLogicalTreeListByBelongTypeAndBelongID = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Vibration/Logic/GetLogicalTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary èŽ·å–è®¾å¤‡åˆ—è¡¨
 */
export const GetEquipmentLogicalTreeListByBelongTypeAndBelongID = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Vibration/Logic/GetEquipmentLogicalTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ ¹æ®æµ‹ç‚¹åˆ—表或者信号下拉选择
 */
export const GetSimpleSignalListByMonitorPointID = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Vibration/Logic/GetSimpleSignalListByMonitorPointID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary
 */
export const GetLimitBySignalIDOfTimeRange = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Std/GetLimitBySignalIDOfTimeRange@V2.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ³¢å½¢å›¾
 */
export const GetWaveSpectrumByMonitorPointIDOfTime = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Vibration/Logic/GetWaveSpectrumByMonitorPointIDOfTime@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary é¢‘谱图
 */
export const GetFrequencySpectrumByMonitorPointIDOfTime = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Vibration/Logic/GetFrequencySpectrumByMonitorPointIDOfTime@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ³¢å½¢é¢‘谱图
 */
export const GetWaveAndFrequencySpectrumByMonitorPointIDOfTime = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Vibration/Logic/GetWaveAndFrequencySpectrumByMonitorPointIDOfTime@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ•…障频率分析
 */
export const GetDegreeFrequencySpectrumByMonitorPointIDOfTime = async (params) => {
    return request({
        url: '/Monitor/Record/Real/Vibration/Logic/GetDegreeFrequencySpectrumByMonitorPointIDOfTime@V1.0',
        method: 'GET',
        params: params,
    });
};
src/api/monitor/yearStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
import request from '/@/utils/request';
/**
 * @summary é€šè¿‡ä¿¡å·ID获取日期区间的数据值
 */
export const GetBySignalIDOfYearRange = async (params) => {
    return request({
        url: '/Monitor/Record/Year/Std/GetBySignalIDOfYearRange@V2.0',
        method: 'GET',
        params: params,
    });
};
src/api/point/monitor/monitorPointStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,39 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–æµ‹ç‚¹ï¼Œæµ‹ç‚¹ä¸Žæµ‹ç‚¹ç»„ç»„åˆ
 */
export const GetMonitorPointStd = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Std/GetLogicalTreeListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * è°ƒç”¨æŽ¥å£ï¼Œè¿”回测点
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getMonitorPointStd = async (params, req: any = request) => {
    const res = await GetMonitorPointStd(params, req);
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        return resData;
    } else {
        ElMessage.error('获取测点失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
/**
 * @summary é€šè¿‡ BelongType and BelongID获取测点组Std (金庭使用)
 */
export const GetTreeItemListByBelongTypeAndBelongID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Group/Std/GetTreeItemListByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params,
    });
};
src/api/point/monitor/monitor_point.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,336 @@
import request from '/@/utils/request';
//#region ====================== èŽ·å–æµ‹ç‚¹ç»„æ ‘å¢žåˆ æ”¹ ======================
/**
 * @summary é€šè¿‡ BelongType and BelongID获取
 */
export const GetAllPointGroup = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Group/GetByBelongTypeAndBelongID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary é€šè¿‡ æ’入一条测点组
 */
export const InsertPointGroup = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Group/Insert@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªæµ‹ç‚¹ç»„记录
 */
export const UpdatePointGroup = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Group/Update@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary åˆ é™¤ä¸€æ¡æµ‹ç‚¹ç»„记录
 */
export const DeletePointGroup = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Group/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
};
/**
 * @summary ä¿®æ”¹æµ‹ç‚¹ç»„表格排序码
 */
export const UpdatePointGroupSorter = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Group/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ£€æŸ¥æ˜¯å¦å·²å­˜åœ¨æ ‡è®°
 */
export const GetIsExistPointGroupTagName = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Group/IsExistTagName@V1.0',
        method: 'GET',
        params: params,
    });
};
//#endregion
//#region ====================== æ¨¡æ¿å¤åˆ¶åŽæ·»åŠ  ======================
/**
 * @summary èŽ·å–ç›‘æµ‹é€‰æ‹©åˆ—è¡¨
 */
export const GetSelectList = async (req: any = request) => {
    return req({
        url: '/Monitor/Point/Template/Std/GetSelectList@V1.0',
        method: 'GET',
    });
};
export const InsertExtensions = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Extensions/Insert@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary æ›´æ–°æµ‹ç‚¹ä½¿ç”¨çŠ¶æ€
 */
export const UpdatePointUseStatus = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/UpdateUseStatus@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary é€šè¿‡ ID èŽ·å–æµ‹ç‚¹ä¿¡æ¯
 */
export const GetByIDAllInfo = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Extensions/GetByID@V1.0',
        method: 'GET',
        params: params,
    });
};
//#endregion
//#region ====================== æµ‹ç‚¹æ·»åŠ  ======================
/**
 * @summary é€šè¿‡ ID èŽ·å–æ¨¡æ¿åˆ—è¡¨
 */
export const GetByIDList = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/GetByGroupID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ’入一条
 */
export const InsertMonitorPoint = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Insert@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary æ›´æ–°æ¨¡æ¿
 */
export const UpdateMonitorPoint = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Update@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ›´æ–°æ¨¡æ¿TagName是否存在
 */
export const UpdatePointTagName = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/IsExistTagName@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary åˆ é™¤æ¨¡æ¿
 */
export const DeleteByIDTemplate = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
};
//#endregion
//#region ======================  ä¿¡å·æ·»åŠ ======================
/**
 * @summary é€šè¿‡ æµ‹ç‚¹ID èŽ·å–ä¿¡å·åˆ—è¡¨
 */
export const GetByMonitorPointID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/GetByMonitorPointID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ’入一条信号
 */
export const InsertSignal = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/Insert@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary æ’入多条信号
 */
export const InsertSignals = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/Inserts@V1.0',
        method: 'POST',
        data: params,
    });
};
/**
 * @summary é€šè¿‡ids èŽ·å–ä¿¡å·
 */
export const GetMonitorSignalByIds = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/GetByIds@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ›´æ–°ä¿¡å·
 */
export const UpdateSignal = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/Update@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary ä¿¡å·çš„æ ‡è®°åç§°æ˜¯å¦å­˜åœ¨
 */
export const GetIsExistSignalTagName = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/IsExistTagName@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary åˆ é™¤ä¿¡å·
 */
export const DeleteByIDSignal = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
};
//获取信号类型
export async function GetLogicalTreeList(req: any = request) {
    return req({
        url: '/Monitor/Signal/Type/Std/GetLogicalTreeList@V1.0',
        method: 'GET',
    });
}
//获取检测公式
export async function GetSupportLogicalTreeList(params, req: any = request) {
    return req({
        url: '/Monitor/Formula/Std/GetSupportLogicalTreeList@V1.0',
        method: 'GET',
        params: params,
    });
}
//#endregion
/**
 * @summary æ›´æ–°æµ‹ç‚¹ flags
 */
export const UpdateMonitorPointFlags = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/UpdateFlags@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ›´æ–°æµ‹ç‚¹æŽ’序码
 */
export const UpdateMonitorPointSorter = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ›´æ–°ä¿¡å·æŽ’序码
 */
export const UpdateSignalSorter = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary é€šè¿‡æµ‹ç‚¹ id èŽ·å–æµ‹ç‚¹
 */
export const GetMonitorPointByID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/GetByID@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary é€šè¿‡ä¸€ç»„测点 id èŽ·å–æµ‹ç‚¹
 */
export const GetMonitorPointByIds = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/GetByIds@V1.0',
        method: 'GET',
        params: params,
    });
};
/**
 * @summary æ›´æ–°æ ‘排序码
 */
export const UpdatePointGroupTreeSortCode = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Group/UpdateTreeSortCode@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ›´æ–°æµ‹ç‚¹æ‰€å±žåˆ†ç»„
 */
export const UpdatePointGroupID = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/UpdateGroupID@V1.0',
        method: 'PUT',
        data: params,
    });
};
src/api/point/monitorTemplate/poinTemplate.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,85 @@
import request from '/@/utils/request';
//#region ====================== æ¯è¡¨æ ¼åˆ—表 ======================
/**
 *
 * @summary
 */
export async function GetAll(req: any = request) {
    return req({
        url: '/Monitor/Point/Template/GetAll@V1.0',
        method: 'GET',
    });
}
//插入一条
export async function InsertGetByID(params, req: any = request) {
    return req({
        url: '/Monitor/Point/Template/Insert@V1.0',
        method: 'POST',
        data: params,
    });
}
//更新一条
export async function UpdateGetByID(params, req: any = request) {
    return req({
        url: '/Monitor/Point/Template/Update@V1.0',
        method: 'PUT',
        data: params,
    });
}
//删除一条
export async function DeleteGetByID(params, req: any = request) {
    return req({
        url: '/Monitor/Point/Template/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
}
/**
 * @summary æ›´æ–°ç”¨æˆ·æŽ’序码
 */
export const UpdateUserSorter = async (params) => {
    return request({
        url: '/Monitor/Point/Template/UpdateSortCode@V1.0',
        method: 'PUT',
        data: params,
    });
};
//根据测点ID获取相应的列表
export async function GetByGroupID(params, req: any = request) {
    return req({
        url: '/Monitor/Signal/Template/GetByTemplateID@V1.0',
        method: 'GET',
        params: params,
    });
}
//获取系统标签
export async function GetBySysType(params, req: any = request) {
    return req({
        url: '/Basic/Sys/Flag/Std/GetFlagListBySysType@V1.0',
        method: 'GET',
        params: params,
    });
}
/**
 * @summary æ›´æ–°æµ‹ç‚¹æ¨¡æ¿ä½¿ç”¨çŠ¶æ€
 */
export const UpdateMonitorPointTemplateUseStatus = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Template/UpdateUseStatus@V1.0',
        method: 'PUT',
        data: params,
    });
};
/**
 * @summary æ›´æ–°æµ‹ç‚¹æ¨¡æ¿ sorter
 */
export const UpdatePointTemplateSorter = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Point/Template/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
//#endregion
src/api/point/signalTemplate/signal.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,79 @@
import request from '/@/utils/request';
//#region ======================信号表格列表 ======================
/**
 *
 * @summary
 */
export async function GetAll(params, req: any = request) {
    return req({
        url: '/Monitor/Signal/Template/GetByTemplateID@V1.0',
        method: 'GET',
        params: params,
    });
}
//插入一条
export async function InsertGetByID(params, req: any = request) {
    return req({
        url: '/Monitor/Signal/Template/Insert@V1.0',
        method: 'POST',
        data: params,
    });
}
//更新一条
export async function UpdateGetByID(params, req: any = request) {
    return req({
        url: '/Monitor/Signal/Template/Update@V1.0',
        method: 'PUT',
        data: params,
    });
}
//删除一条
export async function DeleteGetByID(params, req: any = request) {
    return req({
        url: '/Monitor/Signal/Template/DeleteByID@V1.0',
        method: 'DELETE',
        params: params,
    });
}
/**
 * @summary æ›´æ–°ç”¨æˆ·æŽ’序码
 */
export const UpdateUserSorter = async (params, req: any = request) => {
    return req({
        url: '/Monitor/Signal/Template/UpdateSorter@V1.0',
        method: 'PUT',
        data: params,
    });
};
//获取信号类型
export async function GetLogicalTreeList(req: any = request) {
    return req({
        url: '/Monitor/Signal/Type/Std/GetLogicalTreeList@V1.0',
        method: 'GET',
    });
}
//根据测点ID获取相应的列表
export async function GetByGroupID(params, req: any = request) {
    return req({
        url: '/Monitor/Signal/Template/GetByTemplateID@V1.0',
        method: 'GET',
        params: params,
    });
}
//获取系统标签
export async function GetBySysType(params, req: any = request) {
    return req({
        url: '/Basic/Sys/Flag/Std/GetFlagListBySysType@V1.0',
        method: 'GET',
        params: params,
    });
}
//获取检测公式
export async function GetSupportLogicalTreeList(params, req: any = request) {
    return req({
        url: '/Monitor/Formula/Std/GetSupportLogicalTreeList@V1.0',
        method: 'GET',
        params: params,
    });
}
//#endregion
src/api/run/analyse/runAnalyseConfig.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,90 @@
import type { AxiosInstance } from 'axios';
import request from '/@/utils/request';
export type RunAnalyConfigureGetAllResItem = {
    ID: string;
    ObjectType: string;
    ObjectID: string;
    Frequency: number;
    ChangeTimes: number;
    Description: string;
};
export type RunAnalyConfigurePostParams = {
    ObjectType: string;
    ObjectID: string;
    Frequency: number;
    ChangeTimes: number;
    Description?: string;
};
export type RunAnalyConfigurePutParams = {
    ID: string;
    Frequency: number;
    ChangeTimes: number;
    Description?: string;
};
/**
 * @summary èŽ·å–æ‰€æœ‰è¿è¡Œåˆ†æžé…ç½®
 */
export const GetAllRunAnalyConfigure = async (req: AxiosInstance = request) => {
    return req<RunAnalyConfigureGetAllResItem[]>({
        url: '/Run/Analy/Configure/GetAll@V1.0',
        method: 'get',
    });
};
/**
 * @summary GetRunAnalyConfigureByObjectTypeAndObjectID
 */
export const GetRunAnalyConfigureByObjectTypeAndObjectID = async (params, req: AxiosInstance = request) => {
    return req<RunAnalyConfigureGetAllResItem[]>({
        url: '/Run/Analy/Configure/GetByObjectTypeAndObjectID@V1.0',
        method: 'get',
        params,
    });
};
/**
 * @summary æ·»åŠ ä¸€ä¸ªè¿è¡Œåˆ†æžé…ç½®
 */
export const InsertARunAnalyConfigure = async (data: RunAnalyConfigurePostParams, req: any = request) => {
    return req({
        url: '/Run/Analy/Configure/Insert@V1.0',
        method: 'post',
        data,
    });
};
/**
 * @summary ä¿®æ”¹ä¸€ä¸ªè¿è¡Œåˆ†æžé…ç½®
 */
export const UpdateARunAnalyConfigure = async (data: RunAnalyConfigurePutParams, req: any = request) => {
    return req({
        url: '/Run/Analy/Configure/Update@V1.0',
        method: 'put',
        data,
    });
};
/**
 * @summary SetRunAnalyConfigure
 */
export const SetRunAnalyConfigure = async (data, req: AxiosInstance = request) => {
    return req({
        url: '/Run/Analy/Configure/Set@V1.0',
        method: 'post',
        data,
    });
};
/**
 * @summary åˆ é™¤ä¸€ä¸ªè¿è¡Œåˆ†æžé…ç½®
 */
export const DeleteARunAnalyConfigure = async (params, req: any = request) => {
    return req({
        url: '/Run/Analy/Configure/DeleteByID@V1.0',
        method: 'delete',
        params,
    });
};
src/api/run/real/record/runRealRecord.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,13 @@
import type { AxiosInstance } from 'axios';
import request from '/@/utils/request';
/**
 * @summary InsertRunRealRecordInsertLastRecord@V1.0LastRecord
 */
export const InsertLastRunRealRecord = (data, req: AxiosInstance = request) => {
    return req({
        url: '/Run/Real/Record/InsertLastRecord@V1.0',
        method: 'post',
        data,
    });
};
src/api/run/real/record/runRealRecordStd.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,35 @@
import type { AxiosInstance } from 'axios';
import request from '/@/utils/request';
/**
 * @summary GetRunRealRecordStdGetLimitByObjectTypeAndObjectIDOfDayRange
 */
export const GetRunRealRecordStdGetLimitByObjectTypeAndObjectIDOfDayRange = (params, req: AxiosInstance = request) => {
    return req({
        url: '/Run/Real/Record/Std/GetLimitByObjectTypeAndObjectIDOfDayRange@V1.0',
        method: 'get',
        params,
    });
};
/**
 * @summary GetRunRealRecordStdGetByObjectTypeAndObjectIDOfDayRange
 */
export const GetRunRealRecordStdGetByObjectTypeAndObjectIDOfDayRange = (params, req: AxiosInstance = request) => {
    return req({
        url: '/Run/Real/Record/Std/GetByObjectTypeAndObjectIDOfDayRange@V1.0',
        method: 'get',
        params,
    });
};
/**
 * @summary GetRunRealRecordStdGetLastRecord
 */
export const GetRunRealRecordStdGetLastRecord = (params, req: AxiosInstance = request) => {
    return req({
        url: '/Run/Real/Record/Std/GetLastRecord@V1.0',
        method: 'get',
        params,
    });
};
src/api/run/runRealRecord.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,58 @@
import { ElMessage } from 'element-plus';
import request from '/@/utils/request';
/**
 * @summary èŽ·å–å®žæ—¶è¿è¡Œè®°å½•
 */
export const GetRunRealRecordStd = async (params, req: any = request) => {
    return req({
        url: '/Run/Real/Record/Std/GetLastRecord@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * èŽ·å–å®žæ—¶è¿è¡Œè®°å½•
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getRunRealRecordStd = async (params, req: any = request) => {
    const res = await GetRunRealRecordStd(params, req);
    if (res?.Code === 0) {
        const resData = res.Data as any;
        return resData;
    } else {
        ElMessage.error('获取实时运行记录失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return undefined;
    }
};
/**
 * @summary èŽ·å–å®žæ—¶è¿è¡Œè®°å½•åˆ—è¡¨
 */
export const GetRunRealRecordListStd = async (params, req: any = request) => {
    return req({
        url: '/Run/Real/Record/Std/GetLastRecordList@V1.0',
        method: 'GET',
        params,
    });
};
/**
 * èŽ·å–å®žæ—¶è¿è¡Œè®°å½•åˆ—è¡¨
 * æŠ¥é”™æ—¶è¿”回 undefined
 * @returns
 */
export const getRunRealRecordListStd = async (params, req: any = request) => {
    const res = await GetRunRealRecordListStd(params, req)
    if (res?.Code === 0) {
        const resData = (res.Data || []) as any[];
        return resData;
    } else {
        ElMessage.error('获取实时运行记录失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        return [];
    }
};
src/projectCom/basic/catalog/CatalogManageCom.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,802 @@
<template>
    <el-row :gutter="8" class="h100">
        <el-col :span="4" :xs="24" class="h100">
            <el-card shadow="hover" class="h100 left-tree-card" v-loading="treeLoading">
                <LeftTreeByMgr
                    :treedata="listTreeData"
                    title-name="类型列表"
                    :current-node-key="currentListID"
                    @click="handleClickNode"
                    :folder-icon="(node, data) => data.LogicalType === MODULE_CODE"
                    :default-props="{
                        id: 'LogicalID',
                        label: 'LogicalName',
                        children: 'Children',
                    }"
                >
                </LeftTreeByMgr>
            </el-card>
        </el-col>
        <el-col :span="20" :xs="24" class="flex-column h100">
            <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
                <el-form :inline="true" :model="queryParams">
                    <el-form-item label="名称" prop="Name">
                        <el-input v-model="queryParams.Name" style="width: 226.4px" placeholder="名称" clearable></el-input>
                    </el-form-item>
                    <el-form-item label="编码" prop="Code">
                        <el-input v-model="queryParams.Code" style="width: 226.4px" placeholder="编码" clearable />
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" icon="ele-Search" @click="handleQueryTable"> æŸ¥è¯¢ </el-button>
                        <el-button icon="ele-Refresh" @click="resetQuery">重置 </el-button>
                        <el-button icon="ele-Plus" @click="openOperateDialog()"> å¢žåŠ  </el-button>
                    </el-form-item>
                    <el-form-item label="排序">
                        <el-switch
                            v-model="isDragStatus"
                            @change="handleDragStatus"
                            inline-prompt
                            active-icon="ele-Check"
                            inactive-icon="ele-Close"
                        >
                        </el-switch>
                    </el-form-item>
                </el-form>
            </el-card>
            <el-card class="flex-auto scroll-table-card" shadow="hover" style="margin-top: 8px">
                <el-table
                    v-loading="tableLoading"
                    ref="draggableTableRef"
                    border
                    row-key="ID"
                    :expand-row-keys="treeTableExpandKeys"
                    :tree-props="{ children: 'Children', hasChildren: 'hasChildren' }"
                    :row-class-name="isDragStatus ? 'cursor-move' : 'cursor-pointer'"
                    :cell-style="tableCellCenterExceptColumn()"
                    :header-cell-style="{ textAlign: 'center' }"
                    :data="tableData"
                    @expand-change="tableExpandChange"
                    style="width: 100%"
                    highlight-current-row
                >
                    <el-table-column prop="Name" label="名称" fixed="left" show-overflow-tooltip />
                    <el-table-column prop="Code" label="编码" show-overflow-tooltip />
                    <el-table-column prop="Description" width="550" label="说明" show-overflow-tooltip />
                    <el-table-column label="操作" fixed="right" show-overflow-tooltip width="250">
                        <template #default="scope">
                            <el-button icon="ele-Edit" size="small" text type="primary" @click="openOperateDialog(scope.row)"> ç¼–辑 </el-button>
                            <el-button icon="ele-Folder" size="small" text type="primary" @click="openCatalogOrgDrawer(scope.row)"> ç›®å½• </el-button>
                            <el-button icon="ele-Grid" size="small" text type="primary" @click="openPropertySetDialog(scope.row)"> å±žæ€§ </el-button>
                            <el-dropdown>
                                <el-button icon="ele-MoreFilled" size="small" text type="primary" style="padding-left: 12px" />
                                <template #dropdown>
                                    <el-dropdown-menu>
                                        <el-dropdown-item icon="ele-Menu" @click="openParentDlg(scope.row)"> çˆ¶çº§ </el-dropdown-item>
                                        <el-dropdown-item icon="ele-Delete" @click="deleteCurrentRow(scope.row)" divided> åˆ é™¤ </el-dropdown-item>
                                    </el-dropdown-menu>
                                </template>
                            </el-dropdown>
                        </template>
                    </el-table-column>
                </el-table>
            </el-card>
            <el-dialog :destroy-on-close="true" v-model="dialogIsShow" width="400" :close-on-click-modal="false" @closed="closeDialog">
                <template #header>
                    <div style="color: #fff">
                        <SvgIcon :name="dialogHeaderIcon" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                        <span> {{ dialogTitle }} </span>
                    </div>
                </template>
                <el-form :model="dialogFormValue" ref="dialogFormRef" :rules="dialogFormRules" label-width="55">
                    <el-form-item label="名称" prop="Name">
                        <el-input placeholder="请输入名称" v-model="dialogFormValue.Name"></el-input>
                    </el-form-item>
                    <el-form-item label="编码" prop="Code">
                        <el-input placeholder="请输入唯一编码" v-model="dialogFormValue.Code"></el-input>
                    </el-form-item>
                    <el-form-item label="父级" prop="ParentID">
                        <el-tree-select
                            filterable
                            style="width: 100%"
                            v-model="dialogFormValue.ParentID"
                            :props="{
                                id: 'ID',
                                label: 'Name',
                                children: 'Children',
                            }"
                            :data="tableData"
                            node-key="ID"
                            :clearable="true"
                            :accordion="true"
                            :expandNode="false"
                            :check-strictly="true"
                            placeholder="请选择父级"
                        >
                        </el-tree-select>
                    </el-form-item>
                    <el-form-item label="说明" prop="Description">
                        <el-input placeholder="请输入说明" v-model="dialogFormValue.Description" type="textarea" :rows="3" />
                    </el-form-item>
                </el-form>
                <template #footer>
                    <div>
                        <el-button @click="closeDialog">取 æ¶ˆ</el-button>
                        <el-button type="primary" @click="submitFormValue">ç¡® å®š</el-button>
                    </div>
                </template>
            </el-dialog>
        </el-col>
        <!-- æŠ½å±‰è¡¨æ ¼ -->
        <div class="custom-drawer">
            <el-drawer v-model="catalogOrgDrawerIsShow" direction="rtl" size="18%" :with-header="false">
                <el-card shadow="hover" style="height: 100%" v-loading="catalogOrgDrawerListLoading">
                    <LeftTreeByMgr
                        :titleName="currentCatalogOrgMapRow.Name + ' - åˆ†ç±»ç›®å½•'"
                        :treedata="displayCatalogOrgData"
                        :search-is-show="false"
                        :expand-on-click-node="false"
                    >
                        <template #customTitleRight>
                            <div class="titleSlotRight">
                                <SvgIcon
                                    :size="20"
                                    name="ele-Setting"
                                    color="#528abe"
                                    class="cursor-pointer"
                                    @click="openOperateCatalogOrgSetDialog"
                                />
                            </div>
                        </template>
                    </LeftTreeByMgr>
                </el-card>
            </el-drawer>
        </div>
        <el-dialog
            :destroy-on-close="true"
            v-model="propertySetDialogIsShow"
            width="700"
            :close-on-click-modal="false"
            @closed="closePropertySetDialog"
        >
            <template #header>
                <div style="color: #fff">
                    <SvgIcon name="ele-Grid" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                    <span>设置属性</span>
                </div>
            </template>
            <el-tree
                v-loading="propertyCheckTreeLoading"
                ref="propertyCheckTreeRef"
                :data="propertyCheckTree"
                node-key="LogicalID"
                show-checkbox
                check-strictly
                :props="{ children: 'Children', label: 'LogicalName', class: treeNodeClass, disabled: 'Inherit' }"
                icon="ele-Menu"
                highlight-current
                default-expand-all
            >
                <template #default="{ node, data }">
                    <el-tooltip v-if="data.LogicalType === 'sys-prop-group'" content="属性分组" placement="top-start">
                        {{ node.label }}
                    </el-tooltip>
                    <el-tooltip v-else-if="data.Inherit" content="继承自祖级分类" placement="top-start">
                        {{ node.label }}
                    </el-tooltip>
                    <template v-else>
                        {{ node.label }}
                    </template>
                </template>
            </el-tree>
            <template v-slot:footer>
                <div>
                    <el-button @click="closePropertySetDialog">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitPropertySetForm">ç¡® å®š</el-button>
                </div>
            </template>
        </el-dialog>
        <!-- catalogOrg è®¾ç½®å¯¹è¯æ¡† -->
        <el-dialog
            :destroy-on-close="true"
            v-model="catalogOrgSetDialogIsShow"
            width="700"
            :close-on-click-modal="false"
            @closed="closeCatalogOrgSetDialog"
        >
            <template #header>
                <div style="color: #fff">
                    <SvgIcon name="ele-Setting" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                    <span> è®¾ç½®ç›®å½• </span>
                </div>
            </template>
            <el-form :model="catalogOrgTableForm">
                <!-- æ•°æ®å±•示表格 -->
                <el-table
                    ref="catalogOrgCheckTableRef"
                    v-loading="catalogOrgTableLoading"
                    :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
                    border
                    row-key="ID"
                    :cell-style="tableCellCenterExceptColumn(1)"
                    :header-cell-style="{ textAlign: 'center' }"
                    :data="filteredTableData"
                    :expand-row-keys="catalogOrgExpandRowKeys"
                    style="width: 100%"
                    highlight-current-row
                    row-class-name="cursor-pointer"
                    @select="userSelectCatalogOrg"
                >
                    <el-table-column type="selection" width="55px"> </el-table-column>
                    <el-table-column prop="Name" label="系统分类" fixed="left" show-overflow-tooltip />
                    <el-table-column prop="Count" label="数量" width="130" show-overflow-tooltip>
                        <template #default="scope">
                            <el-form-item>
                                <el-input-number size="small" :min="1" v-model="catalogOrgTableForm[scope.row.ID]"></el-input-number>
                            </el-form-item>
                        </template>
                    </el-table-column>
                </el-table>
            </el-form>
            <template #footer>
                <div>
                    <el-button @click="closeCatalogOrgSetDialog">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitCatalogOrgSetValue">ç¡® å®š</el-button>
                </div>
            </template>
        </el-dialog>
        <ParentDialog
            v-model="parentDlgIsShow"
            :data="treeTableData"
            :api="UpdateCatalogTreeSortCode"
            :rowData="parentDlgMapRow"
            @submitSuccess="submitParentForm"
        >
        </ParentDialog>
    </el-row>
</template>
<script setup lang="ts">
import type { FormInstance, FormRules, TableInstance } from 'element-plus';
import { ElMessage, ElMessageBox, ElTree } from 'element-plus';
import LeftTreeByMgr from '/@/components/tree/leftTreeByMgr.vue';
import type { PropType } from 'vue';
import { ref, onMounted, computed, watch, nextTick } from 'vue';
import { deepClone } from '/@/utils/other';
import { useQueryTable } from '/@/hooks/useQueryTable';
import { useTableSort } from '/@/hooks/useTableSort';
import { useValidateUniqueness } from '/@/hooks/useValidateUniqueness';
import {
    DeleteACatalog,
    GetTypeListTreeData,
    GetAllCatalogByID,
    GetIsExistCatalogCode,
    InsertACatalog,
    UpdateACatalog,
    UpdateCatalogSorter,
    GetCatalogOrgByParentID,
    GetHaveLogicalTreeList,
    SetCatalogMapProperty,
    SetCatalogOrg,
    UpdateCatalogTreeSortCode,
} from '/@/api/basic/dataManage/catalogManage';
import { ExtendTypeEnum } from '/@/projectCom/basic/types';
import { convertListToTree, travelTree, tableCellCenterExceptColumn, flatten } from '/@/utils/util';
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
import { MODULE_CODE } from '/@/constants';
import ParentDialog from '/@/components/dialog/parentDialog/ParentDialog.vue';
const props = defineProps({
    request: {
        type: Function as PropType<(config: AxiosRequestConfig<any>) => Promise<AxiosResponse<any, any>>>,
    },
});
//#region ====================== å·¦ä¾§æ ‘数据,tree init ======================
const treeLoading = ref(false);
const listTreeData = ref([]);
const currentListID = ref('');
const currentTreeNode = ref(null);
const handleClickNode = (data) => {
    currentListID.value = data.LogicalID;
    currentTreeNode.value = data;
    if (data.LogicalType === MODULE_CODE) {
        tableData.value = [];
        return;
    }
    getTableData();
};
const getListTreeData = async () => {
    treeLoading.value = true;
    const res = await GetTypeListTreeData(
        {
            ExtendType: ExtendTypeEnum.Inherit,
        },
        props.request
    ).finally(() => {
        treeLoading.value = false;
    });
    if (res?.Code === 0) {
        listTreeData.value = res.Data || [];
        const firstListTreeNode = listTreeData.value[0]?.Children[0];
        if (firstListTreeNode) {
            handleClickNode(firstListTreeNode);
        } else {
            tableData.value = [];
            currentTreeNode.value = null;
            currentListID.value = null;
        }
    } else {
        ElMessage.error('获取类型列表失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
//#endregion
//#region ====================== è¡¨æ ¼æ•°æ®ï¼Œtable init ======================
const tableLoading = ref(false);
const flatTableData = ref([]);
// æ ‘形态的表格数据
const treeTableData = ref([]);
const isDragStatus = ref(false);
// ä¿å­˜å½“前 ID èŠ‚ç‚¹çš„æ ¹èŠ‚ç‚¹ ID;
let IDRootMap = {};
const getTableData = async () => {
    tableLoading.value = true;
    const res = await GetAllCatalogByID({ TypeID: currentListID.value }, props.request).finally(() => {
        tableLoading.value = false;
    });
    if (res?.Code === 0) {
        flatTableData.value = res.Data || [];
        treeTableData.value = convertListToTree(flatTableData.value);
        // æ¯ä¸€ä¸ªæ ‘节点有一个 RootID,指向当前节点的最上层的根节点 ID
        let rootID = '';
        travelTree(treeTableData.value, (value) => {
            if (value.ParentID === '0') {
                rootID = value.ID;
            }
            value.RootID = rootID;
            IDRootMap[value.ID] = rootID;
        });
    } else {
        ElMessage.error('获取分类失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
const deleteCurrentRow = (row: any) => {
    ElMessageBox.confirm(`确定删除分类:【${row.Name}】?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    }).then(async () => {
        const res = await DeleteACatalog(
            {
                ID: row.ID,
            },
            props.request
        );
        if (res?.Code === 0) {
            if (res.Data) {
                ElMessage.success('删除分类成功');
                getTableData();
            } else {
                ElMessage.error('删除分类失败');
            }
        } else {
            ElMessage.error('删除分类失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    });
};
//#endregion
//#region ====================== è¡¨æ ¼æŸ¥è¯¢ã€æŽ’序,search form init ======================
const queryParams = ref({
    Name: '',
    Code: '',
});
const { resetQuery, handleQueryTable, displayTableData: tableData } = useQueryTable(flatTableData, queryParams, getTableData, true);
const { handleDragStatus, draggableTableRef } = useTableSort(
    tableData,
    UpdateCatalogSorter,
    getTableData,
    undefined,
    true,
    props.request
);
//#endregion
//#region ====================== å¢žåŠ ã€ä¿®æ”¹è®°å½•æ“ä½œ, dialog init======================
const isEditDialog = ref(false);
const dialogTitle = computed(() => {
    return isEditDialog.value ? '修改分类' : '添加分类';
});
const dialogHeaderIcon = computed(() => {
    return isEditDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const dialogFormValue = ref(null);
const dialogIsShow = ref(false);
const dialogFormRef = ref<FormInstance>(null);
const initialCode = ref('');
const { uniquenessValidator } = useValidateUniqueness(
    GetIsExistCatalogCode,
    initialCode,
    '编码',
    'Code',
    {
        CorpID: currentListID,
    },
    false,
    props.request
);
const dialogFormRules = ref<FormRules>({
    Name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
    Code: [{ required: true, validator: uniquenessValidator as any, trigger: 'blur' }],
});
const openOperateDialog = (row?) => {
    if (!currentListID.value) {
        return ElMessage.warning('请先选择类型!');
    }
    if (row) {
        isEditDialog.value = true;
        const { ID, Name, Code, Description, ParentID } = row;
        initialCode.value = Code;
        dialogFormValue.value = deepClone({
            TypeID: currentTreeNode.value.LogicalID,
            ID,
            Name,
            Code,
            Description,
            ParentID: ParentID === '0' ? null : ParentID,
        });
    } else {
        if (currentTreeNode.value.LogicalType === MODULE_CODE) {
            return ElMessage.info('请选择系统类型,再添加数据');
        }
        isEditDialog.value = false;
        initialCode.value = '';
        dialogFormValue.value = { Name: '', Code: '', Description: '', ParentID: null, TypeID: currentListID.value };
    }
    dialogIsShow.value = true;
};
const closeDialog = () => {
    dialogIsShow.value = false;
    dialogFormRef.value.clearValidate();
};
const submitFormValue = async () => {
    const valid = await dialogFormRef.value.validate().catch(() => {});
    if (!valid) return;
    if (!dialogFormValue.value.ParentID) {
        dialogFormValue.value.ParentID = '0';
    }
    if (isEditDialog.value) {
        const res = await UpdateACatalog(dialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTableData();
                closeDialog();
                ElMessage.success('修改分类成功');
            } else {
                ElMessage.error('修改分类失败');
            }
        } else {
            ElMessage.error('修改分类失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    } else {
        const res = await InsertACatalog(dialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTableData();
                closeDialog();
                ElMessage.success('添加分类成功');
            } else {
                ElMessage.success('添加分类失败');
            }
        } else {
            ElMessage.error('添加分类失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    }
};
//#endregion
//#region ====================== æŠ½å±‰æ ‘数据 ======================
const catalogOrgDrawerIsShow = ref(false);
const catalogOrgDrawerListsData = ref([]);
const catalogOrgDrawerListLoading = ref(false);
let currentCatalogOrgOrgID = '';
/**展示的目录数据 */
const displayCatalogOrgData = computed(() => {
    return catalogOrgDrawerListsData.value.map((item) => {
        let foundCatalog = {
            // ID æ˜¯ç›®å½•ID
            ID: '0',
            Name: '-',
            // CatalogID æ˜¯åˆ†ç±»ID
            CatalogID: '0',
        };
        for (const value of flatTableData.value) {
            if (value.ID === item.ChildID) {
                foundCatalog = {
                    ID: item.ID,
                    Name: value.Name,
                    CatalogID: value.ID,
                };
                break;
            }
        }
        return foundCatalog;
    });
});
const getCatalogOrgDrawerListDataByID = async () => {
    catalogOrgDrawerListLoading.value = true;
    const res = await GetCatalogOrgByParentID({ ParentID: currentCatalogOrgOrgID }, props.request).finally(() => {
        catalogOrgDrawerListLoading.value = false;
    });
    if (res?.Code === 0) {
        if (res.Data) {
            catalogOrgDrawerListsData.value = res.Data;
        } else {
            catalogOrgDrawerListsData.value = [];
        }
    } else {
        ElMessage.error('获取目录失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
const currentCatalogOrgMapRow = ref(null);
const openCatalogOrgDrawer = (row?) => {
    const { ID } = row;
    currentCatalogOrgMapRow.value = row;
    currentCatalogOrgOrgID = ID;
    getCatalogOrgDrawerListDataByID();
    catalogOrgDrawerIsShow.value = true;
};
//#endregion
//#region ====================== è§£å†³æ‹–拽展开状态失效问题 ======================
const treeTableExpandKeys = ref([]);
const tableExpandChange = (row, expanded) => {
    if (expanded) {
        treeTableExpandKeys.value.push(row.ID);
    } else {
        const idx = treeTableExpandKeys.value.indexOf(row.ID);
        treeTableExpandKeys.value.splice(idx, 1);
    }
};
//#endregion
//#region ====================== åˆ†ç±»å±žæ€§è®¾ç½® ======================
const propertySetDialogIsShow = ref(false);
const propertyCheckTree = ref([]);
const propertyCheckTreeRef = ref<InstanceType<typeof ElTree>>(null);
let currentCatalog = null;
const openPropertySetDialog = (row) => {
    propertySetDialogIsShow.value = true;
    currentCatalog = row;
    getPropertyByCatalogID();
};
const getCheckedKeys = (treeData: any) => {
    const checkedKeys = [];
    const getKeys = (treeData: any) => {
        for (const item of treeData) {
            if (item.Have) {
                checkedKeys.push(item.LogicalID);
            }
            if (item.Children && item.Children.length !== 0) {
                getKeys(item.Children);
            }
        }
    };
    getKeys(treeData);
    return checkedKeys;
};
const propertyCheckTreeLoading = ref(false);
const getPropertyByCatalogID = async () => {
    propertyCheckTreeLoading.value = true;
    const res = await GetHaveLogicalTreeList({ CatalogID: currentCatalog?.ID }, props.request).finally(() => {
        propertyCheckTreeLoading.value = false;
    });
    if (res?.Code === 0) {
        if (res.Data) {
            propertyCheckTree.value = res.Data;
            const checkedKeys = getCheckedKeys(propertyCheckTree.value);
            propertyCheckTreeRef.value.setCheckedKeys(checkedKeys);
        }
    } else {
        ElMessage.error('获取属性失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
const closePropertySetDialog = () => {
    propertySetDialogIsShow.value = false;
    propertyCheckTreeRef.value.setCheckedNodes([]);
};
// å¶å­èŠ‚ç‚¹åŒè¡Œæ˜¾ç¤ºæ ·å¼
const treeNodeClass = (node) => {
    let addClass = true; // æ·»åŠ å¶å­èŠ‚ç‚¹åŒè¡Œæ˜¾ç¤ºæ ·å¼
    for (const key in node.Children) {
        // å¦‚果存在子节点非叶子节点,不添加样式
        if (node.Children[key].Children?.length ?? 0 > 0) {
            addClass = false;
            break;
        }
    }
    const checkboxClass = node.LogicalType === 'sys-prop-group' ? 'sys-prop-group' : 'sys-prop';
    const penultimateClass = addClass ? 'penultimate-node' : '';
    const treeNodeClass = checkboxClass + ' ' + penultimateClass;
    return treeNodeClass;
};
const submitPropertySetForm = async () => {
    const checkedKeys = propertyCheckTreeRef.value
        .getCheckedNodes()
        .filter((item) => item.LogicalType === 'sys-prop' && !item.Inherit)
        .map((item) => item.LogicalID);
    const res = await SetCatalogMapProperty({ CatalogID: currentCatalog?.ID, PropIds: checkedKeys }, props.request);
    if (res?.Code === 0) {
        if (res.Data) {
            propertySetDialogIsShow.value = false;
            ElMessage.success('设置成功');
        } else {
            ElMessage.info('未修改');
        }
    } else {
        ElMessage.error('设置失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
//#endregion
//#region ======================设置目录操作, dialog init======================
const catalogOrgSetDialogIsShow = ref(false);
const catalogOrgTableLoading = ref(false);
const catalogOrgCheckTableRef = ref<TableInstance>(null);
const catalogOrgTableForm = ref({});
const filteredTableData = ref([]);
const setCatalogOrgTableData = () => {
    filteredTableData.value = deepClone(
        treeTableData.value.filter((item) => item.RootID !== IDRootMap[currentCatalogOrgMapRow.value.ID])
    ) as any[];
    travelTree(filteredTableData.value, (value) => {
        value.children = value.Children;
    });
    const checkedKeysObj = {};
    displayCatalogOrgData.value.forEach((value) => {
        if (!checkedKeysObj[value.CatalogID]) {
            checkedKeysObj[value.CatalogID] = 1;
        } else {
            checkedKeysObj[value.CatalogID]++;
        }
    });
    nextTick(() => {
        nextTick(() => {
            catalogOrgCheckTableRef.value?.clearSelection();
            const catalogIDCount = {};
            travelTree(
                filteredTableData.value,
                (value) => {
                    const IDMapCount = checkedKeysObj[value.ID];
                    if (IDMapCount) {
                        catalogOrgCheckTableRef.value?.toggleRowSelection(value, true);
                    } else {
                        catalogOrgCheckTableRef.value?.toggleRowSelection(value, false);
                    }
                    catalogIDCount[value.ID] = IDMapCount || 1;
                },
                null,
                false,
                'children'
            );
            catalogOrgTableForm.value = catalogIDCount;
        });
    });
};
const userSelectCatalogOrg = (checkedRow, currentRow) => {
    const isChecked = checkedRow.includes(currentRow);
    if (isChecked) {
        if (currentRow.children?.length > 0) {
            for (const item of currentRow.children) {
                catalogOrgCheckTableRef.value?.toggleRowSelection(item, false);
            }
        }
    }
};
const openOperateCatalogOrgSetDialog = () => {
    resetCatalogOrgTable();
    setCatalogOrgTableData();
    catalogOrgSetDialogIsShow.value = true;
};
// å±•开的 tree
const catalogOrgExpandRowKeys = ref([]);
const resetCatalogOrgTable = () => {
    catalogOrgExpandRowKeys.value = [];
};
const closeCatalogOrgSetDialog = () => {
    catalogOrgSetDialogIsShow.value = false;
};
const submitCatalogOrgSetValue = async () => {
    const selectedRows = catalogOrgCheckTableRef.value.getSelectionRows();
    const CatalogIDs = [];
    selectedRows.forEach((row) => {
        const count = catalogOrgTableForm.value[row.ID];
        for (let index = 0; index < count; index++) {
            CatalogIDs.push(row.ID);
        }
    });
    const sendParams = {
        ParentID: currentCatalogOrgOrgID,
        ChildIds: CatalogIDs,
    };
    catalogOrgTableLoading.value = true;
    const res = await SetCatalogOrg(sendParams, props.request).finally(() => {
        catalogOrgTableLoading.value = false;
    });
    if (res?.Code === 0) {
        if (res.Data) {
            closeCatalogOrgSetDialog();
            getCatalogOrgDrawerListDataByID();
            ElMessage.success('设置目录成功');
        } else {
            ElMessage.error('设置目录失败');
        }
    } else {
        ElMessage.error('设置目录失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
//#endregion
//#region ====================== æ›´æ”¹è®¾å¤‡çˆ¶çº§ ======================
const parentDlgIsShow = ref(false);
const parentDlgMapRow = ref(null);
const openParentDlg = (row?) => {
    parentDlgMapRow.value = row;
    parentDlgIsShow.value = true;
};
const submitParentForm = (res) => {
    getTableData();
};
//#endregion
onMounted(() => {
    getListTreeData();
});
</script>
<style scoped lang="scss">
:deep(.sys-prop-group > .el-tree-node__content > .el-checkbox) {
    display: none;
}
.titleSlotRight {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
</style>
src/projectCom/basic/constants.ts
src/projectCom/basic/flag/FlagManageCom.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,319 @@
<template>
    <el-row :gutter="8" class="h100">
        <el-col :span="4" :xs="24" class="h100">
            <el-card shadow="hover" class="h100 left-tree-card" v-loading="treeLoading">
                <LeftTreeByMgr
                    title-name="类型列表"
                    :treedata="listTreeData"
                    :current-node-key="currentListID"
                    :default-props="{
                        children: 'Children',
                        label: 'LogicalName',
                        id: 'LogicalID',
                    }"
                    :folder-icon="(node, data) => data.LogicalType === MODULE_CODE"
                    :default-expand-all="true"
                    @click="handleClickNode"
                >
                </LeftTreeByMgr>
            </el-card>
        </el-col>
        <el-col :span="20" :xs="24" class="flex-column h100">
            <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
                <el-form :inline="true" :model="queryParams">
                    <el-form-item label="标签名称" prop="Name">
                        <el-input v-model="queryParams.Name" style="width: 226.4px" placeholder="名称" clearable></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" icon="ele-Search" @click="handleQueryTable"> æŸ¥è¯¢ </el-button>
                        <el-button icon="ele-Refresh" @click="resetQuery">重置 </el-button>
                        <el-button icon="ele-Plus" @click="openOperateDialog()"> å¢žåŠ  </el-button>
                    </el-form-item>
                    <el-form-item label="排序">
                        <el-switch
                            v-model="isDragStatus"
                            @change="handleDragStatus"
                            inline-prompt
                            active-icon="ele-Check"
                            inactive-icon="ele-Close"
                        >
                        </el-switch>
                    </el-form-item>
                </el-form>
            </el-card>
            <el-card class="flex-auto scroll-table-card" shadow="hover" style="margin-top: 8px">
                <el-table
                    v-loading="tableLoading"
                    ref="draggableTableRef"
                    border
                    row-key="ID"
                    :row-class-name="isDragStatus ? 'cursor-move' : 'cursor-pointer'"
                    :cell-style="{ textAlign: 'center' }"
                    :header-cell-style="{ textAlign: 'center' }"
                    :data="displayTableData"
                    style="width: 100%"
                    highlight-current-row
                >
                    <el-table-column prop="Name" label="名称" fixed="left" show-overflow-tooltip />
                    <el-table-column prop="Description" width="550" label="说明" show-overflow-tooltip />
                    <el-table-column label="操作" fixed="right" show-overflow-tooltip>
                        <template #default="scope">
                            <el-button icon="ele-Edit" size="small" text type="primary" @click="openOperateDialog(scope.row)"> ç¼–辑 </el-button>
                            <el-button icon="ele-Delete" size="small" text type="danger" @click="deleteCurrentRow(scope.row)"> åˆ é™¤ </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-card>
            <el-dialog :destroy-on-close="true" v-model="dialogIsShow" width="400" :close-on-click-modal="false" @closed="closeDialog">
                <template #header>
                    <div style="color: #fff">
                        <SvgIcon :name="dialogHeaderIcon" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                        <span> {{ dialogTitle }} </span>
                    </div>
                </template>
                <el-form :model="dialogFormValue" ref="dialogFormRef" :rules="dialogFormRules" label-width="55">
                    <el-form-item label="名称" prop="Name">
                        <el-input placeholder="请输入名称" v-model="dialogFormValue.Name"></el-input>
                    </el-form-item>
                    <el-form-item label="说明" prop="Description">
                        <el-input placeholder="请输入说明" v-model="dialogFormValue.Description" type="textarea" :rows="3" />
                    </el-form-item>
                </el-form>
                <template #footer>
                    <div>
                        <el-button @click="closeDialog">取 æ¶ˆ</el-button>
                        <el-button type="primary" @click="submitFormValue">ç¡® å®š</el-button>
                    </div>
                </template>
            </el-dialog>
        </el-col>
    </el-row>
</template>
<script setup lang="ts">
import type { FormInstance, FormRules } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import LeftTreeByMgr from '/@/components/tree/leftTreeByMgr.vue';
import type { PropType } from 'vue';
import { ref, onMounted, computed } from 'vue';
import { deepClone } from '/@/utils/other';
import { useQueryTable } from '/@/hooks/useQueryTable';
import { useTableSort } from '/@/hooks/useTableSort';
import {
    DeleteAFlag,
    GetTypeListTreeData,
    GetAllFlagByID,
    GetIsExistFlagName,
    InsertAFlag,
    UpdateAFlag,
    UpdateFlagSorter,
} from '/@/api/basic/flagInfo';
import { useValidateUniqueness } from '/@/hooks/useValidateUniqueness';
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
import { MODULE_CODE } from '/@/constants';
const props = defineProps({
    request: {
        type: Function as PropType<(config: AxiosRequestConfig<any>) => Promise<AxiosResponse<any, any>>>,
    },
});
//#region ====================== å·¦ä¾§æ ‘数据,tree with select init ======================
const treeLoading = ref(false);
const currentTreeNode = ref(null);
const listTreeData = ref([]);
const currentListID = ref('');
const handleClickNode = (data) => {
    currentTreeNode.value = data;
    currentListID.value = data.LogicalID;
    if (data.LogicalType === MODULE_CODE) {
        tableData.value = [];
        return;
    }
    getTableData();
};
const getListTreeData = async () => {
    treeLoading.value = true;
    const res = await GetTypeListTreeData(props.request).finally(() => {
        treeLoading.value = false;
    });
    if (res?.Code === 0) {
        listTreeData.value = res.Data || [];
        const firstListTreeNode = listTreeData.value[0]?.Children[0];
        if (firstListTreeNode) {
            handleClickNode(firstListTreeNode);
        } else {
            tableData.value = [];
            currentTreeNode.value = null;
            currentListID.value = null;
        }
    } else {
        ElMessage.error('获取类型列表失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
//#endregion
//#region ====================== è¡¨æ ¼æ•°æ®ï¼Œtable init ======================
const tableLoading = ref(false);
const tableData = ref([]);
const isDragStatus = ref(false);
const getTableData = async () => {
    tableLoading.value = true;
    const res = await GetAllFlagByID({ TypeID: currentListID.value }, props.request).finally(() => {
        tableLoading.value = false;
    });
    if (res?.Code === 0) {
        tableData.value = res.Data || [];
    } else {
        ElMessage.error('获取标签失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
const deleteCurrentRow = (row: any) => {
    ElMessageBox.confirm(`确定删除标签:【${row.Name}】?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    }).then(async () => {
        const res = await DeleteAFlag(
            {
                ID: row.ID,
            },
            props.request
        );
        if (res?.Code === 0) {
            if (res.Data) {
                ElMessage.success('删除标签成功');
                getTableData();
            } else {
                ElMessage.error('删除标签失败');
            }
        } else {
            ElMessage.error('删除标签失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    });
};
//#endregion
//#region ====================== è¡¨æ ¼æŸ¥è¯¢ã€æŽ’序,search form init ======================
const queryParams = ref({
    Name: '',
});
const { handleDragStatus, draggableTableRef } = useTableSort(
    tableData,
    UpdateFlagSorter,
    getTableData,
    undefined,
    false,
    props.request
);
const { resetQuery, handleQueryTable, displayTableData } = useQueryTable(tableData, queryParams, getTableData);
//#endregion
//#region ====================== å¢žåŠ ã€ä¿®æ”¹è®°å½•æ“ä½œ, dialog init======================
const isEditDialog = ref(false);
const dialogTitle = computed(() => {
    return isEditDialog.value ? '修改标签' : '添加标签';
});
const dialogHeaderIcon = computed(() => {
    return isEditDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const dialogFormValue = ref({
    Name: '',
    Description: '',
}) as any;
const dialogIsShow = ref(false);
const dialogFormRef = ref<FormInstance>(null);
const initialValue = ref('');
const { uniquenessValidator: nameValidator } = useValidateUniqueness(
    GetIsExistFlagName,
    initialValue,
    '标签名称',
    'Name',
    {
        TypeID: currentListID,
    },
    false,
    props.request
);
//#endregion
const dialogFormRules = ref<FormRules>({
    Name: [{ required: true, validator: nameValidator as any, trigger: 'blur' }],
});
const currentRow = ref(null);
const openOperateDialog = (row?) => {
    if (!currentListID.value) {
        return ElMessage.warning('请先选择类型!');
    }
    if (row) {
        isEditDialog.value = true;
        initialValue.value = row.Name;
        currentRow.value = row;
        const { ID, Name, Description } = row;
        dialogFormValue.value = deepClone({ ID, Name, Description });
    } else {
        if (currentTreeNode.value.LogicalType === MODULE_CODE) return ElMessage.warning('请先选择系统类型再添加!');
        initialValue.value = '';
        isEditDialog.value = false;
        dialogFormValue.value = { Name: '', Description: '' };
    }
    dialogIsShow.value = true;
};
const closeDialog = () => {
    dialogIsShow.value = false;
    dialogFormRef.value.clearValidate();
};
const submitFormValue = async () => {
    const valid = await dialogFormRef.value.validate().catch(() => {});
    if (!valid) return;
    if (isEditDialog.value) {
        const res = await UpdateAFlag(dialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTableData();
                closeDialog();
                ElMessage.success('修改标签成功');
            } else {
                ElMessage.error('修改标签失败');
            }
        } else {
            ElMessage.error('修改标签失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    } else {
        const res = await InsertAFlag({ ...dialogFormValue.value, TypeID: currentListID.value }, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTableData();
                closeDialog();
                ElMessage.success('添加标签成功');
            } else {
                ElMessage.error('添加标签失败');
            }
        } else {
            ElMessage.error('添加标签失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    }
};
//#endregion
onMounted(() => {
    getListTreeData();
});
</script>
<style scoped lang="scss"></style>
src/projectCom/basic/prop/PropManageCom.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,872 @@
<template>
    <el-row :gutter="8" class="h100">
        <el-col :span="4" :xs="24" class="h100">
            <el-card shadow="hover" class="h100 left-tree-card" v-loading="treeLoading">
                <LeftTreeByMgr
                    ref="leftTreeRef"
                    title-name="属性组列表"
                    :show-add="true"
                    :select-is-show="true"
                    :showSelectNodeIcon="true"
                    :selectFolderIcon="(_, data) => data.LogicalType === MODULE_CODE"
                    :select-data="selectTreeData"
                    :show-more-operate="true"
                    :select-props="{
                        id: 'LogicalID',
                        label: 'LogicalName',
                        children: 'Children',
                    }"
                    :default-select-value="currentSelectID"
                    :folder-icon="() => false"
                    @selectchange="selectNodeChange"
                    :treedata="listTreeData"
                    :current-node-key="currentListID"
                    :show-sorter="true"
                    @click="handleClickNode"
                    @node-drag-end="dragNodeEnd"
                    @tree-edit="openOperatePropertyGroupDialog"
                    @tree-delete="deleteCurrentPropertyGroup"
                    @tree-add="openOperatePropertyGroupDialog"
                >
                </LeftTreeByMgr>
            </el-card>
        </el-col>
        <el-col :span="20" :xs="24" class="flex-column h100">
            <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
                <el-form :inline="true" :model="queryParams">
                    <el-form-item label="名称" prop="Name">
                        <el-input v-model="queryParams.Name" style="width: 226.4px" placeholder="名称" clearable></el-input>
                    </el-form-item>
                    <el-form-item label="编码" prop="Code">
                        <el-input v-model="queryParams.Code" style="width: 226.4px" placeholder="编码" clearable />
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" icon="ele-Search" @click="handleQueryTable"> æŸ¥è¯¢ </el-button>
                        <el-button icon="ele-Refresh" @click="resetQuery">重置 </el-button>
                        <el-button icon="ele-Plus" @click="openOperatePropertyDialog()"> å¢žåŠ  </el-button>
                    </el-form-item>
                    <el-form-item label="排序">
                        <el-switch
                            v-model="isDragStatus"
                            @change="handleDragStatus"
                            inline-prompt
                            active-icon="ele-Check"
                            inactive-icon="ele-Close"
                        >
                        </el-switch>
                    </el-form-item>
                </el-form>
            </el-card>
            <el-card class="flex-auto scroll-table-card" shadow="hover" style="margin-top: 8px">
                <el-table
                    v-loading="tableLoading"
                    ref="draggableTableRef"
                    border
                    row-key="ID"
                    :row-class-name="isDragStatus ? 'cursor-move' : 'cursor-pointer'"
                    :cell-style="{ textAlign: 'center' }"
                    :header-cell-style="{ textAlign: 'center' }"
                    :data="displayTableData"
                    style="width: 100%"
                    highlight-current-row
                >
                    <el-table-column type="index" label="序号" width="55" align="center" />
                    <el-table-column prop="Name" label="名称" show-overflow-tooltip />
                    <el-table-column prop="Code" label="编码" show-overflow-tooltip />
                    <el-table-column prop="Format" label="格式" show-overflow-tooltip>
                        <template #default="scope">
                            {{ FORMAT_MAP[scope.row.Format] }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="UnitName" label="单位" show-overflow-tooltip />
                    <el-table-column prop="DefaultValue" label="默认值" align="center" show-overflow-tooltip> </el-table-column>
                    <el-table-column prop="IsNull" label="可空" show-overflow-tooltip>
                        <template #default="scope">
                            <el-tag type="success" v-if="scope.row.IsNull">是</el-tag>
                            <el-tag type="danger" v-else>否</el-tag>
                        </template>
                    </el-table-column>
                    <el-table-column prop="Description" label="说明" show-overflow-tooltip />
                    <el-table-column label="操作" width="240" fixed="right" align="center" show-overflow-tooltip>
                        <template #default="scope">
                            <el-button icon="ele-Edit" size="small" text type="primary" @click="openOperatePropertyDialog(scope.row)">
                                ç¼–辑
                            </el-button>
                            <el-button icon="ele-Grid" size="small" text type="primary" @click="openDrawer(scope.row)"> å±žæ€§é€‰é¡¹ </el-button>
                            <el-button icon="ele-Delete" size="small" text type="danger" @click="deleteCurrentRow(scope.row)"> åˆ é™¤ </el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </el-card>
        </el-col>
        <!-- property å¢žåŠ ã€ä¿®æ”¹æ•°æ®å¯¹è¯æ¡† -->
        <el-dialog
            :destroy-on-close="true"
            v-model="propertyDialogIsShow"
            width="500"
            :close-on-click-modal="false"
            @closed="closePropertyDialog"
        >
            <template #header>
                <div style="color: #fff">
                    <SvgIcon :name="propertyDialogHeaderIcon" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                    <span> {{ propertyDialogTitle }} </span>
                </div>
            </template>
            <el-form :model="propertyDialogFormValue" ref="propertyDialogFormRef" :rules="propertyDialogFormRules" label-width="80">
                <el-form-item label="名称" prop="Name">
                    <el-input placeholder="请输入名称" v-model="propertyDialogFormValue.Name"></el-input>
                </el-form-item>
                <el-form-item label="编码" prop="Code">
                    <el-input placeholder="请输入唯一编码" v-model="propertyDialogFormValue.Code"></el-input>
                </el-form-item>
                <el-form-item label="属性格式" prop="Format">
                    <el-select v-model="propertyDialogFormValue.Format" class="w100" filterable @change="selectFormatChange">
                        <el-option
                            v-for="item of Object.keys(FORMAT_MAP)"
                            :key="item"
                            :label="FORMAT_MAP[item]"
                            :value="parseInt(item)"
                        ></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="单位名称" prop="UnitName">
                    <el-input v-model="propertyDialogFormValue.UnitName" clearable />
                </el-form-item>
                <el-form-item label="默认值" prop="DefaultValue">
                    <el-radio-group
                        class="w100"
                        v-if="propertyDialogFormValue.Format === PropertyFormatEnum.Boolean"
                        v-model="propertyDialogFormValue.DefaultValue"
                    >
                        <el-radio label="true" value="true"></el-radio>
                        <el-radio label="false" value="false"></el-radio>
                    </el-radio-group>
                    <el-input v-else v-model="propertyDialogFormValue.DefaultValue"></el-input>
                </el-form-item>
                <el-form-item label="是否可空" prop="IsNull">
                    <el-checkbox v-model="propertyDialogFormValue.IsNull" />
                </el-form-item>
                <el-form-item label="说明" prop="Description">
                    <el-input v-model="propertyDialogFormValue.Description" type="textarea" :rows="3" />
                </el-form-item>
            </el-form>
            <template #footer>
                <div>
                    <el-button @click="closePropertyDialog">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitPropertyFormValue">ç¡® å®š</el-button>
                </div>
            </template>
        </el-dialog>
        <!-- propertyGroup å¢žåŠ ã€ä¿®æ”¹æ•°æ®å¯¹è¯æ¡† -->
        <el-dialog
            :destroy-on-close="true"
            v-model="propertyGroupDialogIsShow"
            width="400"
            :close-on-click-modal="false"
            @closed="closePropertyGroupDialog"
        >
            <template #header>
                <div style="color: #fff">
                    <SvgIcon
                        :name="propertyGroupDialogHeaderIcon"
                        :size="16"
                        style="margin-right: 3px; display: inline; vertical-align: middle"
                    />
                    <span> {{ propertyGroupDialogTitle }} </span>
                </div>
            </template>
            <el-form
                :model="propertyGroupDialogFormValue"
                ref="propertyGroupDialogFormRef"
                :rules="propertyGroupDialogFormRules"
                label-width="55"
            >
                <el-form-item label="名称" prop="Name">
                    <el-input placeholder="请输入名称" v-model="propertyGroupDialogFormValue.Name"></el-input>
                </el-form-item>
                <el-form-item label="说明" prop="Description">
                    <el-input placeholder="请输入说明" v-model="propertyGroupDialogFormValue.Description" type="textarea" :rows="3" />
                </el-form-item>
            </el-form>
            <template #footer>
                <div>
                    <el-button @click="closePropertyGroupDialog">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitPropertyGroupFormValue">ç¡® å®š</el-button>
                </div>
            </template>
        </el-dialog>
        <!-- å±žæ€§é€‰é¡¹ä¿®æ”¹ã€ç¼–辑dialog -->
        <el-dialog
            :destroy-on-close="true"
            v-model="choiceDialogIsShow"
            width="400"
            :close-on-click-modal="false"
            @closed="closeChoiceDialog"
        >
            <template #header>
                <div style="color: #fff">
                    <SvgIcon :name="choiceDialogHeaderIcon" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                    <span> {{ choiceDialogTitle }} </span>
                </div>
            </template>
            <el-form :model="choiceDialogFormValue" ref="choiceDialogFormRef" :rules="choiceDialogFormRules" label-width="55">
                <el-form-item label="名称" prop="Name">
                    <el-input placeholder="请输入名称" v-model="choiceDialogFormValue.Name"></el-input>
                </el-form-item>
                <el-form-item label="选项" prop="Choice">
                    <el-input placeholder="请输入选项" v-model="choiceDialogFormValue.Choice"></el-input>
                </el-form-item>
                <el-form-item label="说明" prop="Description">
                    <el-input placeholder="请输入说明" v-model="choiceDialogFormValue.Description" type="textarea" :rows="3" />
                </el-form-item>
            </el-form>
            <template v-slot:footer>
                <div>
                    <el-button @click="closeChoiceDialog">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitChoiceFormValue">ç¡® å®š</el-button>
                </div>
            </template>
        </el-dialog>
        <!-- æŠ½å±‰è¡¨æ ¼ -->
        <div class="custom-drawer">
            <el-drawer v-model="drawerIsShow" direction="rtl" size="30%">
                <template #header>
                    <div>
                        <SvgIcon name="ele-Grid" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                        <span> {{ currentProp?.Name + ' - å±žæ€§é€‰é¡¹é…ç½®' }} </span>
                    </div>
                </template>
                <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
                    <!-- æŸ¥è¯¢ã€é‡ç½®ã€æŽ’序、增加表单 -->
                    <el-form :inline="true" :model="choiceQueryParams">
                        <el-form-item>
                            <el-button icon="ele-Plus" @click="openOperateChoiceDialog()"> å¢žåŠ  </el-button>
                        </el-form-item>
                        <el-form-item label="排序">
                            <el-switch
                                v-model="isChoiceTableDrag"
                                @change="handleChoiceTableDrag"
                                inline-prompt
                                active-icon="ele-Check"
                                inactive-icon="ele-Close"
                            >
                            </el-switch>
                        </el-form-item>
                    </el-form>
                </el-card>
                <el-card class="flex-auto scroll-table-card" shadow="hover" style="margin-top: 8px">
                    <!-- æ•°æ®å±•示表格 -->
                    <el-table
                        v-loading="choiceTableLoading"
                        class="h100"
                        ref="draggableChoiceTableRef"
                        border
                        size="small"
                        row-key="ID"
                        :row-class-name="isChoiceTableDrag ? 'cursor-move' : 'cursor-pointer'"
                        :cell-style="{ textAlign: 'center' }"
                        :header-cell-style="{ textAlign: 'center' }"
                        :data="choiceTableData"
                        style="width: 100%"
                        highlight-current-row
                    >
                        <el-table-column prop="Name" label="名称" fixed="left" show-overflow-tooltip />
                        <el-table-column prop="Choice" label="选项" show-overflow-tooltip />
                        <el-table-column prop="Description" label="说明" show-overflow-tooltip />
                        <el-table-column label="操作" fixed="right" width="180" show-overflow-tooltip>
                            <template #default="scope">
                                <el-button icon="ele-Edit" size="small" text type="primary" @click="openOperateChoiceDialog(scope.row)">
                                    ç¼–辑
                                </el-button>
                                <el-button icon="ele-Delete" size="small" text type="danger" @click="deleteCurrentChoiceRow(scope.row)">
                                    åˆ é™¤
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-card>
            </el-drawer>
        </div>
    </el-row>
</template>
<script setup lang="ts">
import type { FormInstance, FormRules } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import LeftTreeByMgr from '/@/components/tree/leftTreeByMgr.vue';
import type { PropType } from 'vue';
import { ref, onMounted, computed, nextTick } from 'vue';
import { deepClone } from '/@/utils/other';
import { useQueryTable } from '/@/hooks/useQueryTable';
import { updateSort, useTableSort } from '/@/hooks/useTableSort';
import { useValidateUniqueness } from '/@/hooks/useValidateUniqueness';
import {
    // èŽ·å–ç³»ç»Ÿç±»åž‹
    GetSysTypeSelectTreeData,
    // å±žæ€§æŽ¥å£
    DeleteAProperty,
    GetAllPropertyByID,
    GetIsExistPropertyCode,
    InsertAProperty,
    UpdateAProperty,
    UpdatePropertySorter,
    // å±žæ€§ç»„接口
    GetPropertyGroupListTreeData,
    DeleteAPropertyGroup,
    InsertAPropertyGroup,
    UpdateAPropertyGroup,
    UpdatePropertyGroupSorter,
} from '/@/api/basic/property/propertyManage';
import {
    DeleteAPropChoice,
    GetAllPropChoice,
    InsertAPropChoice,
    UpdateAPropChoice,
    UpdatePropChoiceSorter,
} from '/@/api/basic/property/propChoice';
import { FORMAT_MAP, PropertyFormatEnum } from '/@/projectCom/basic/types';
import { booleanRegex, dateRegex, integerRegex, numberRegex } from '/@/utils/toolsValidate';
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
import { MODULE_CODE } from '/@/constants';
import { arrayIsEmpty } from '/@/utils/util';
const props = defineProps({
    request: {
        type: Function as PropType<(config: AxiosRequestConfig<any>) => Promise<AxiosResponse<any, any>>>,
    },
});
//#region ====================== å·¦ä¾§æ ‘数据,tree with select init ======================
const treeLoading = ref(false);
const selectTreeData = ref([]);
const currentSelectID = ref('');
const selectNodeChange = (data) => {
    currentSelectID.value = data.LogicalID;
    if (data.LogicalType === MODULE_CODE) {
        listTreeData.value = [];
        tableData.value = [];
        return;
    }
    getListTreeData(true);
};
const getSelectTreeData = async () => {
    treeLoading.value = true;
    const res = await GetSysTypeSelectTreeData(props.request).finally(() => {
        treeLoading.value = false;
    });
    if (res?.Code === 0) {
        selectTreeData.value = res.Data || [];
        const firstSelectTreeNode = selectTreeData.value[0]?.Children[0];
        if (firstSelectTreeNode) {
            selectNodeChange(firstSelectTreeNode);
        } else {
            listTreeData.value = [];
            tableData.value = [];
        }
    } else {
        ElMessage.error('获取系统类型列表失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
const leftTreeRef = ref(null);
const listTreeData = ref([]);
const currentListID = ref('');
const currentTreeNode = ref(null);
const handleClickNode = (data) => {
    currentTreeNode.value = data;
    nextTick(() => {
        leftTreeRef.value?.treeRef.setCurrentKey(data.ID);
    });
    currentListID.value = data.ID;
    getTableData();
};
const getListTreeData = async (selectFirst = false) => {
    treeLoading.value = true;
    const res = await GetPropertyGroupListTreeData(
        {
            TypeID: currentSelectID.value,
        },
        props.request
    ).finally(() => {
        treeLoading.value = false;
    });
    if (res?.Code === 0) {
        listTreeData.value = res.Data || [];
        if (selectFirst) {
            const firstListTreeNode = listTreeData.value[0];
            if (firstListTreeNode) {
                handleClickNode(firstListTreeNode);
            } else {
                tableData.value = [];
                currentTreeNode.value = null;
                currentListID.value = null;
            }
        } else {
            currentTreeNode.value && handleClickNode(currentTreeNode.value);
        }
    } else {
        ElMessage.error('获取属性组列表失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
//#endregion
//#region ====================== å·¦ä¾§æ ‘拖拽 ======================
const dragNodeEnd = async (draggingNode, dropNode, dropType, ev, originTreeData) => {
    updateSort(
        listTreeData,
        listTreeData.value,
        originTreeData,
        () => {
            handleClickNode(draggingNode.data);
            getListTreeData();
        },
        UpdatePropertyGroupSorter,
        () => {
            handleClickNode(draggingNode.data);
        },
        undefined,
        props.request
    );
};
//#endregion
//#region ====================== è¡¨æ ¼æ•°æ®ï¼Œtable init ======================
const tableLoading = ref(false);
const tableData = ref([]);
const isDragStatus = ref(false);
const getTableData = async () => {
    tableLoading.value = true;
    const res = await GetAllPropertyByID({ GroupID: currentListID.value }, props.request).finally(() => {
        tableLoading.value = false;
    });
    if (res?.Code === 0) {
        tableData.value = res.Data || [];
    } else {
        ElMessage.error('获取属性失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
const deleteCurrentRow = (row: any) => {
    ElMessageBox.confirm(`确定删除属性:【${row.Name}】?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    }).then(async () => {
        const res = await DeleteAProperty(
            {
                ID: row.ID,
            },
            props.request
        );
        if (res?.Code === 0) {
            if (res.Data) {
                ElMessage.success('删除属性成功');
                getTableData();
            } else {
                ElMessage.error('删除属性失败');
            }
        } else {
            ElMessage.error('删除属性失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    });
};
//#endregion
//#region ====================== è¡¨æ ¼æŸ¥è¯¢ã€æŽ’序,search form init ======================
const queryParams = ref({
    Name: '',
    Code: '',
});
const { handleDragStatus, draggableTableRef } = useTableSort(
    tableData,
    UpdatePropertySorter,
    getTableData,
    undefined,
    false,
    props.request
);
const { resetQuery, handleQueryTable, displayTableData } = useQueryTable(tableData, queryParams, getTableData);
//#endregion
const selectFormatChange = () => {
    propertyDialogFormValue.value.DefaultValue = '';
    propertyDialogFormRef.value.clearValidate(['DefaultValue']);
};
//#region ====================== å¢žåŠ ã€ä¿®æ”¹è®°å½•æ“ä½œ, dialog init======================
const isEditPropertyDialog = ref(false);
const propertyDialogTitle = computed(() => {
    return isEditPropertyDialog.value ? '修改属性' : '添加属性';
});
const propertyDialogHeaderIcon = computed(() => {
    return isEditPropertyDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const propertyDialogFormValue = ref(null);
const propertyDialogIsShow = ref(false);
const propertyDialogFormRef = ref<FormInstance>(null);
const propertyInitialCode = ref('');
const { uniquenessValidator: propertyCodeValidator } = useValidateUniqueness(
    GetIsExistPropertyCode,
    propertyInitialCode,
    '编码',
    'Code',
    {
        TypeID: currentSelectID,
    },
    false,
    props.request
);
const defaultValueValidator = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback();
    } else if (!propertyDialogFormValue.value.Format) {
        callback('请先选择属性格式,再填写默认值');
    } else {
        if (propertyDialogFormValue.value.Format === PropertyFormatEnum.Numeric && !numberRegex.test(value)) {
            callback('请输入数字');
        } else if (
            [PropertyFormatEnum.Bigint, PropertyFormatEnum.Integer].includes(propertyDialogFormValue.value.Format) &&
            !integerRegex.test(value)
        ) {
            callback('请输入整数');
        } else if (PropertyFormatEnum.Time === propertyDialogFormValue.value.Format && !dateRegex.test(value)) {
            callback('请输入正确的日期格式(yyyy-MM-dd HH:mm:ss æˆ– yyyy-MM-dd)');
        } else if (PropertyFormatEnum.Boolean === propertyDialogFormValue.value.Format && !booleanRegex.test(value)) {
            callback('请选择 true æˆ– false');
        } else {
            callback();
        }
    }
};
const propertyDialogFormRules = ref<FormRules>({
    Name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
    Code: [{ required: true, validator: propertyCodeValidator as any, trigger: 'blur' }],
    Format: [{ required: true, message: '请选择格式', trigger: 'change' }],
    DefaultValue: [{ validator: defaultValueValidator as any, trigger: 'blur' }],
});
const openOperatePropertyDialog = (row?) => {
    if (!currentListID.value) {
        return ElMessage.warning('请先选择属性组!');
    }
    if (row) {
        isEditPropertyDialog.value = true;
        const { ID, Name, Format, UnitName, IsNull, DefaultValue, Code, Description } = row;
        propertyInitialCode.value = Code;
        propertyDialogFormValue.value = deepClone({ ID, Name, Format, UnitName, IsNull, DefaultValue, Code, Description });
    } else {
        isEditPropertyDialog.value = false;
        propertyInitialCode.value = '';
        propertyDialogFormValue.value = {
            GroupID: currentListID.value,
            Name: '',
            Format: null,
            UnitName: '',
            IsNull: true,
            DefaultValue: '',
            Code: '',
            Description: '',
        };
    }
    propertyDialogIsShow.value = true;
};
const closePropertyDialog = () => {
    propertyDialogIsShow.value = false;
    propertyDialogFormRef.value.clearValidate();
};
const submitPropertyFormValue = async () => {
    const valid = await propertyDialogFormRef.value.validate().catch(() => {});
    if (!valid) return;
    if (isEditPropertyDialog.value) {
        const res = await UpdateAProperty(propertyDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTableData();
                closePropertyDialog();
                ElMessage.success('修改属性成功');
            } else {
                ElMessage.error('修改属性失败');
            }
        } else {
            ElMessage.error('修改属性失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    } else {
        const res = await InsertAProperty(propertyDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTableData();
                closePropertyDialog();
                ElMessage.success('添加属性成功');
            } else {
                ElMessage.error('添加属性失败');
            }
        } else {
            ElMessage.error('添加属性失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    }
};
//#endregion
//#region ====================== å¢žåŠ ã€åˆ é™¤å±žæ€§ç»„æ“ä½œ, dialog init======================
const isEditPropertyGroupDialog = ref(false);
const propertyGroupDialogTitle = computed(() => {
    return isEditPropertyGroupDialog.value ? '修改属性组' : '添加属性组';
});
const propertyGroupDialogHeaderIcon = computed(() => {
    return isEditPropertyGroupDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const propertyGroupDialogFormValue = ref(null);
const propertyGroupDialogIsShow = ref(false);
const propertyGroupDialogFormRef = ref<FormInstance>(null);
const propertyGroupDialogFormRules = ref<FormRules>({
    Name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
});
const openOperatePropertyGroupDialog = (data?) => {
    if (data) {
        isEditPropertyGroupDialog.value = true;
        const { ID, Name, Description } = data;
        propertyGroupDialogFormValue.value = deepClone({ ID, Name, Description });
    } else {
        isEditPropertyGroupDialog.value = false;
        propertyGroupDialogFormValue.value = { TypeID: currentSelectID.value, Name: '', Description: '' };
    }
    propertyGroupDialogIsShow.value = true;
};
const closePropertyGroupDialog = () => {
    propertyGroupDialogIsShow.value = false;
    propertyGroupDialogFormRef.value.clearValidate();
};
const submitPropertyGroupFormValue = async () => {
    const valid = await propertyGroupDialogFormRef.value.validate().catch(() => {});
    if (!valid) return;
    if (isEditPropertyGroupDialog.value) {
        const res = await UpdateAPropertyGroup(propertyGroupDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getListTreeData();
                closePropertyGroupDialog();
                ElMessage.success('修改属性组成功');
            } else {
                ElMessage.error('修改属性组失败');
            }
        } else {
            ElMessage.error('修改属性组失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    } else {
        const res = await InsertAPropertyGroup(propertyGroupDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getListTreeData();
                closePropertyGroupDialog();
                ElMessage.success('添加属性组成功');
            } else {
                ElMessage.error('添加属性组失败');
            }
        } else {
            ElMessage.error('添加属性组失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    }
};
//#endregion
//#region ====================== åˆ é™¤å·¦ä¾§æ ‘属性组数据 ======================
const deleteCurrentPropertyGroup = (row: any) => {
    ElMessageBox.confirm(`确定删除属性组:【${row.Name}】?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    }).then(async () => {
        const res = await DeleteAPropertyGroup(
            {
                ID: row.ID,
            },
            props.request
        );
        if (res?.Code === 0) {
            if (res.Data) {
                ElMessage.success('删除属性组成功');
                getListTreeData(true);
            } else {
                ElMessage.error('删除属性组失败');
            }
        } else {
            ElMessage.error('删除属性组失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    });
};
//#endregion
//#region ====================== å±žæ€§é€‰é¡¹ drawer ======================
const drawerIsShow = ref(false);
const currentProp = ref(null);
const openDrawer = (row: any) => {
    drawerIsShow.value = true;
    currentProp.value = row;
    getChoiceTableData();
};
//#endregion
//#region ====================== å±žæ€§é€‰é¡¹CRUD ======================
//#region ====================== èŽ·å–ã€åˆ é™¤è¡¨æ ¼æ•°æ® ======================
const choiceTableLoading = ref(false);
const choiceTableData = ref([]);
const isChoiceTableDrag = ref(false);
const nextChoiceValue = computed(() => {
    if (arrayIsEmpty(choiceTableData.value)) {
        return '0';
    } else {
        const lastItem = choiceTableData.value.at(-1);
        if (integerRegex.test(lastItem.Choice)) {
            return Number(lastItem.Choice) + 1 + '';
        } else {
            return '';
        }
    }
});
const getChoiceTableData = async () => {
    choiceTableLoading.value = true;
    const res = await GetAllPropChoice({ PropID: currentProp.value.ID }, props.request).finally(() => {
        choiceTableLoading.value = false;
    });
    if (res?.Code === 0) {
        choiceTableData.value = res.Data || [];
    } else {
        ElMessage.error('获取属性选项失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
const deleteCurrentChoiceRow = (row: any) => {
    ElMessageBox.confirm(`确定删除属性选项:【${row.Name}】?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    }).then(async () => {
        const res = await DeleteAPropChoice(
            {
                ID: row.ID,
            },
            props.request
        );
        if (res?.Code === 0) {
            if (res.Data) {
                ElMessage.success('删除属性选项成功');
                getChoiceTableData();
            } else {
                ElMessage.error('删除属性选项失败');
            }
        } else {
            ElMessage.error('删除属性选项失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    });
};
//#endregion
const choiceQueryParams = ref({
    Name: '',
});
const { handleDragStatus: handleChoiceTableDrag, draggableTableRef: draggableChoiceTableRef } = useTableSort(
    choiceTableData,
    UpdatePropChoiceSorter,
    getChoiceTableData,
    undefined,
    false,
    props.request
);
//#region ====================== å¢žåŠ ã€ä¿®æ”¹è®°å½•æ“ä½œ, dialog init======================
const isEditChoiceDialog = ref(false);
const choiceDialogTitle = computed(() => {
    return isEditChoiceDialog.value ? '修改属性选项' : '添加属性选项';
});
const choiceDialogHeaderIcon = computed(() => {
    return isEditChoiceDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const choiceDialogFormValue = ref(null);
const choiceDialogIsShow = ref(false);
const choiceDialogFormRef = ref<FormInstance>(null);
const choiceDialogFormRules = ref<FormRules>({
    Name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
    Choice: [{ required: true, message: '请输入属性选项', trigger: 'blur' }],
    DefaultValue: [{ validator: defaultValueValidator, trigger: 'blur' }],
});
const openOperateChoiceDialog = (row?) => {
    if (row) {
        isEditChoiceDialog.value = true;
        const { ID, Name, Choice, Description } = row;
        choiceDialogFormValue.value = deepClone({ ID, Name, Choice, Description });
    } else {
        isEditChoiceDialog.value = false;
        choiceDialogFormValue.value = { PropID: currentProp.value.ID, Name: '', Choice: nextChoiceValue.value, Description: '' };
    }
    choiceDialogIsShow.value = true;
};
const closeChoiceDialog = () => {
    choiceDialogIsShow.value = false;
    choiceDialogFormRef.value.clearValidate();
};
const submitChoiceFormValue = async () => {
    const valid = await choiceDialogFormRef.value.validate().catch(() => {});
    if (!valid) return;
    if (isEditChoiceDialog.value) {
        const res = await UpdateAPropChoice(choiceDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getChoiceTableData();
                closeChoiceDialog();
                ElMessage.success('修改属性选项成功');
            } else {
                ElMessage.error('修改属性选项失败');
            }
        } else {
            ElMessage.error('修改属性选项失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    } else {
        const res = await InsertAPropChoice(choiceDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getChoiceTableData();
                closeChoiceDialog();
                ElMessage.success('添加属性选项成功');
            } else {
                ElMessage.error('添加属性选项失败');
            }
        } else {
            ElMessage.error('添加属性选项失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    }
};
//#endregion
onMounted(() => {
    getSelectTreeData();
});
</script>
<style scoped lang="scss"></style>
src/projectCom/basic/sys/alarm/level/AlarmLevelCom.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,234 @@
<template>
    <div class="h100 flex-column">
        <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
            <el-form :inline="true" :model="queryParams">
                <el-form-item label="名称" prop="Name">
                    <el-input v-model="queryParams.Name" style="width: 226.4px" placeholder="名称" clearable />
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" icon="ele-Search" @click="handleQueryTable"> æŸ¥è¯¢ </el-button>
                    <el-button icon="ele-Refresh" @click="resetQuery">重置 </el-button>
                    <el-button icon="ele-Plus" @click="openOperateDialog()"> å¢žåŠ  </el-button>
                </el-form-item>
                <el-form-item label="排序">
                    <el-switch v-model="isDragStatus" @change="handleDragStatus" inline-prompt active-icon="ele-Check" inactive-icon="ele-Close">
                    </el-switch>
                </el-form-item>
            </el-form>
        </el-card>
        <el-card class="flex-auto scroll-table-card" shadow="hover" style="margin-top: 8px">
            <el-table
                v-loading="tableLoading"
                ref="draggableTableRef"
                border
                row-key="ID"
                :row-class-name="isDragStatus ? 'cursor-move' : 'cursor-pointer'"
                :cell-style="{ textAlign: 'center' }"
                :header-cell-style="{ textAlign: 'center' }"
                :data="displayTableData"
                style="width: 100%"
                highlight-current-row
            >
                <el-table-column prop="Name" width="220" label="名称" fixed="left" show-overflow-tooltip />
                <el-table-column prop="Color" label="颜色" show-overflow-tooltip>
                    <template #default="scope">
                        <div class="w100 h100 flex-center">
                            <div style="width: 65px; height: 25px" :style="'background-color:' + scope.row.Color"></div>
                        </div>
                    </template>
                </el-table-column>
                <el-table-column prop="Grade" label="报警等级" show-overflow-tooltip />
                <el-table-column prop="Description" width="550" label="说明" show-overflow-tooltip />
                <el-table-column label="操作" width="150" fixed="right" show-overflow-tooltip>
                    <template #default="scope">
                        <el-button icon="ele-Edit" size="small" text type="primary" @click="openOperateDialog(scope.row)"> ç¼–辑 </el-button>
                        <el-button
                            icon="ele-Delete"
                            size="small"
                            text
                            type="danger"
                            @click="
                                deleteCurrentRow(scope.row, '报警等级', alarmLevelApi.DeleteABasicSysAlarmLevel, () => {
                                    getTableData();
                                })
                            "
                        >
                            åˆ é™¤
                        </el-button>
                    </template>
                </el-table-column>
            </el-table>
        </el-card>
        <el-dialog :destroy-on-close="true" v-model="dialogIsShow" width="450" :close-on-click-modal="false" @closed="closeDialog">
            <template #header>
                <div style="color: #fff">
                    <SvgIcon :name="dialogHeaderIcon" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                    <span> {{ dialogTitle }} </span>
                </div>
            </template>
            <el-form :model="dialogFormValue" ref="dialogFormRef" :rules="dialogFormRules" label-width="78">
                <el-form-item label="名称" prop="Name">
                    <el-input placeholder="请输入名称" v-model="dialogFormValue.Name"></el-input>
                </el-form-item>
                <el-form-item label="颜色" prop="Color">
                    <el-color-picker v-model="dialogFormValue.Color" />
                </el-form-item>
                <el-form-item label="报警等级" prop="Grade">
                    <el-input-number class="w100" placeholder="请输入报警等级" v-model="dialogFormValue.Grade"></el-input-number>
                </el-form-item>
                <el-form-item label="说明" prop="Description">
                    <el-input placeholder="请输入说明" v-model="dialogFormValue.Description" type="textarea" :rows="3" />
                </el-form-item>
            </el-form>
            <template #footer>
                <div>
                    <el-button @click="closeDialog">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitFormValue">ç¡® å®š</el-button>
                </div>
            </template>
        </el-dialog>
    </div>
</template>
<script setup lang="ts">
import { ElMessage, FormInstance, FormRules } from 'element-plus';
import { ref, onMounted, computed, PropType } from 'vue';
import { deepClone } from '/@/utils/other';
import { useQueryTable } from '/@/hooks/useQueryTable';
import { useTableSort } from '/@/hooks/useTableSort';
import * as alarmLevelApi from '/@/api/basic/alarmLevel';
import { AxiosRequestConfig, AxiosResponse } from 'axios';
import { deleteCurrentRow } from '/@/utils/util';
import { useValidateUniqueness } from '/@/hooks/useValidateUniqueness';
const props = defineProps({
    request: {
        type: Function as PropType<(config: AxiosRequestConfig<any>) => Promise<AxiosResponse<any, any>>>,
    },
});
//#region ====================== è¡¨æ ¼æ•°æ®ï¼Œtable init ======================
const tableLoading = ref(false);
const tableData = ref([]);
const isDragStatus = ref(false);
const getTableData = async () => {
    tableLoading.value = true;
    const res = await alarmLevelApi.GetAllBasicSysAlarmLevel(props.request).finally(() => {
        tableLoading.value = false;
    });
    if (res?.Code === 0) {
        const resData = (res.Data || []) as [];
        tableData.value = resData;
    } else {
        ElMessage.error('获取报警等级失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
//#endregion
//#region ====================== è¡¨æ ¼æŸ¥è¯¢ã€æŽ’序,search form init ======================
const queryParams = ref({
    Name: '',
});
const { handleDragStatus, draggableTableRef } = useTableSort(
    tableData,
    alarmLevelApi.UpdateBasicSysAlarmLevelSorter,
    getTableData,
    undefined,
    false,
    props.request
);
const { resetQuery, handleQueryTable, displayTableData } = useQueryTable(tableData, queryParams, getTableData);
//#endregion
//#region ====================== å¢žåŠ ã€ä¿®æ”¹è®°å½•æ“ä½œ, dialog init======================
const isEditDialog = ref(false);
const dialogTitle = computed(() => {
    return isEditDialog.value ? '修改报警等级' : '添加报警等级';
});
const dialogHeaderIcon = computed(() => {
    return isEditDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const dialogFormValue = ref(null);
const dialogIsShow = ref(false);
const dialogFormRef = ref<FormInstance>(null);
const initialGrade = ref(null);
const { uniquenessValidator } = useValidateUniqueness(
    alarmLevelApi.IsExistBasicSysAlarmLevelGrade,
    initialGrade,
    '报警等级',
    'Grade',
    undefined,
    false,
    props.request
);
const dialogFormRules = ref<FormRules>({
    Name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
    Color: [{ required: true, message: '请选择颜色', trigger: 'blur' }],
    Grade: [{ required: true, validator: uniquenessValidator as any, trigger: 'blur' }],
});
const openOperateDialog = (row?) => {
    if (row) {
        isEditDialog.value = true;
        const { ID, Name, Color, Grade, Description } = row;
        initialGrade.value = Grade;
        dialogFormValue.value = deepClone({ ID, Name, Color, Grade, Description });
    } else {
        isEditDialog.value = false;
        initialGrade.value = null;
        dialogFormValue.value = { Name: '', Color: '', Grade: null, Description: '' };
    }
    dialogIsShow.value = true;
};
const closeDialog = () => {
    dialogIsShow.value = false;
    dialogFormRef.value.clearValidate();
};
const submitFormValue = async () => {
    const valid = await dialogFormRef.value.validate().catch(() => {});
    if (!valid) return;
    if (isEditDialog.value) {
        const res = await alarmLevelApi.UpdateABasicSysAlarmLevel(dialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTableData();
                closeDialog();
                ElMessage.success('修改报警等级成功');
            } else {
                ElMessage.error('修改报警等级失败');
            }
        } else {
            ElMessage.error('修改报警等级失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    } else {
        const res = await alarmLevelApi.InsertABasicSysAlarmLevel(dialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTableData();
                closeDialog();
                ElMessage.success('添加报警等级成功');
            } else {
                ElMessage.error('添加报警等级失败');
            }
        } else {
            ElMessage.error('添加报警等级失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    }
};
//#endregion
onMounted(() => {
    getTableData();
});
</script>
<style scoped lang="scss"></style>
src/projectCom/basic/sys/alarm/types.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
export const enum AlarmStatusEnum {
    Creation = 0,
    Processing = 1,
    FeedBack = 2,
}
export const alarmStatusMap: Record<AlarmStatusEnum, string> = {
    [AlarmStatusEnum.Creation]: '创建',
    [AlarmStatusEnum.Processing]: '处理',
    [AlarmStatusEnum.FeedBack]: '反馈',
};
src/projectCom/basic/sys/paras/SysParasCom.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,646 @@
<template>
    <!-- å·¦ä¾§åˆ†ç±»ç›®å½•树,上部表格操作 card,下部 table æ•°æ®å±•示 -->
    <div class="h100">
        <el-row :gutter="8" class="h100">
            <el-col :span="4" :xs="24" class="h100">
                <el-card shadow="hover" class="h100" v-loading="treeLoading">
                    <!-- ç›®å½•æ ‘ -->
                    <LeftTreeByMgr
                        class="h100 left-tree-card"
                        ref="leftTreeRef"
                        :treedata="listTreeData"
                        title-name="分组列表"
                        :show-more-operate="true"
                        :show-add="true"
                        :folderIcon="() => false"
                        :current-node-key="currentListID"
                        :expand-on-click-node="false"
                        :default-expand-all="true"
                        :show-sorter="true"
                        @click="handleClickNode"
                        :customDropdown="true"
                        @tree-add="openOperateGroupDialog"
                        @node-drag-end="dragNodeEnd"
                    >
                        <template #customDropdown="{ data, node }">
                            <el-dropdown-menu>
                                <el-dropdown-item>
                                    <el-button
                                        @click.stop="() => openOperateGroupDialog(data)"
                                        link
                                        type="primary"
                                        icon="ele-Edit"
                                        style="cursor: pointer"
                                    >
                                        ç¼–辑
                                    </el-button>
                                </el-dropdown-item>
                                <el-dropdown-item>
                                    <el-button link type="danger" @click.stop="() => deleteCurrentGroup(data)" icon="ele-Delete" style="cursor: pointer">
                                        åˆ é™¤
                                    </el-button>
                                </el-dropdown-item>
                                <el-dropdown-item>
                                    <el-button @click.stop="() => openParentDlg(data)" link type="primary" icon="ele-Menu" style="cursor: pointer">
                                        çˆ¶çº§
                                    </el-button>
                                </el-dropdown-item>
                            </el-dropdown-menu>
                        </template>
                    </LeftTreeByMgr>
                </el-card>
            </el-col>
            <el-col :span="20" :xs="24" class="flex-column h100">
                <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
                    <!-- æŸ¥è¯¢ã€é‡ç½®ã€æŽ’序、增加表单 -->
                    <el-form :inline="true" :model="parasQueryParams">
                        <el-form-item label="名称" prop="Name">
                            <el-input v-model="parasQueryParams.Name" style="width: 226.4px" placeholder="名称" clearable></el-input>
                        </el-form-item>
                        <el-form-item label="编码" prop="Code">
                            <el-input v-model="parasQueryParams.Code" style="width: 226.4px" placeholder="编码" clearable />
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" icon="ele-Search" @click="handleQueryParasTable"> æŸ¥è¯¢ </el-button>
                            <el-button icon="ele-Refresh" @click="resetParasQuery">重置 </el-button>
                            <el-button icon="ele-Plus" @click="openOperateParasDialog()"> å¢žåŠ  </el-button>
                        </el-form-item>
                        <el-form-item label="排序">
                            <el-switch
                                :disabled="displayParasTableData !== parasTableData"
                                v-model="isParasTableDrag"
                                @change="handleParasTableDrag"
                                inline-prompt
                                active-icon="ele-Check"
                                inactive-icon="ele-Close"
                            >
                            </el-switch>
                        </el-form-item>
                    </el-form>
                </el-card>
                <el-card class="flex-auto scroll-table-card" shadow="hover" style="margin-top: 8px">
                    <!-- æ•°æ®å±•示表格 -->
                    <el-table
                        v-loading="parasTableLoading"
                        ref="draggableTypeTableRef"
                        border
                        row-key="ID"
                        :row-class-name="isParasTableDrag ? 'cursor-move' : 'cursor-pointer'"
                        :cell-style="{ textAlign: 'center' }"
                        :header-cell-style="{ textAlign: 'center' }"
                        :data="displayParasTableData"
                        style="width: 100%"
                        highlight-current-row
                    >
                        <el-table-column prop="Name" width="240" label="名称" fixed="left" show-overflow-tooltip />
                        <el-table-column prop="Code" width="300" label="编码" show-overflow-tooltip />
                        <el-table-column prop="Format" label="格式" show-overflow-tooltip>
                            <template #default="scope">
                                {{ FORMAT_MAP[scope.row.Format] }}
                            </template>
                        </el-table-column>
                        <el-table-column prop="PValue" label="参数值" show-overflow-tooltip />
                        <el-table-column prop="Description" label="说明" width="550" show-overflow-tooltip />
                        <el-table-column label="操作" width="160" fixed="right" show-overflow-tooltip>
                            <template #default="scope">
                                <el-button icon="ele-Edit" size="small" text type="primary" @click="openOperateParasDialog(scope.row)">
                                    ç¼–辑
                                </el-button>
                                <el-button icon="ele-Delete" size="small" text type="danger" @click="deleteCurrentTypeRow(scope.row)">
                                    åˆ é™¤
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-card>
            </el-col>
        </el-row>
        <el-dialog
            :destroy-on-close="true"
            v-model="groupDialogIsShow"
            width="400"
            :close-on-click-modal="false"
            @closed="closeGroupDialog"
        >
            <template #header>
                <div style="color: #fff">
                    <SvgIcon :name="groupDialogHeaderIcon" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                    <span> {{ groupDialogTitle }} </span>
                </div>
            </template>
            <el-form :model="groupDialogFormValue" ref="groupDialogFormRef" :rules="groupDialogFormRules" label-width="55">
                <el-form-item label="父级" v-if="!isEditGroupDialog" prop="ParentID">
                    <el-tree-select
                        default-expand-all
                        filterable
                        style="width: 100%"
                        v-model="groupDialogFormValue.ParentID"
                        :props="{
                            id: 'ID',
                            label: 'Name',
                            children: 'Children',
                        }"
                        :data="listTreeData"
                        node-key="ID"
                        :clearable="true"
                        :accordion="true"
                        :expandNode="false"
                        :check-strictly="true"
                        placeholder="请选择父级"
                    >
                    </el-tree-select>
                </el-form-item>
                <el-form-item label="名称" prop="Name">
                    <el-input placeholder="请输入名称" v-model="groupDialogFormValue.Name"></el-input>
                </el-form-item>
                <el-form-item label="说明" prop="Description">
                    <el-input placeholder="请输入说明" v-model="groupDialogFormValue.Description" type="textarea" :rows="3" />
                </el-form-item>
            </el-form>
            <template #footer>
                <div>
                    <el-button @click="closeGroupDialog">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitGroupFormValue">ç¡® å®š</el-button>
                </div>
            </template>
        </el-dialog>
        <!-- å¢žåŠ ã€ä¿®æ”¹æ•°æ®å¯¹è¯æ¡† -->
        <el-dialog
            :destroy-on-close="true"
            v-model="parasDialogIsShow"
            width="400"
            :close-on-click-modal="false"
            @closed="closeParasDialog"
        >
            <template #header>
                <div style="color: #fff">
                    <SvgIcon :name="parasDialogHeaderIcon" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                    <span> {{ parasDialogTitle }} </span>
                </div>
            </template>
            <el-form :model="parasDialogFormValue" ref="parasDialogFormRef" :rules="parasDialogFormRules" label-width="78">
                <el-form-item label="名称" prop="Name">
                    <el-input placeholder="请输入名称" v-model="parasDialogFormValue.Name"></el-input>
                </el-form-item>
                <el-form-item label="编码" prop="Code">
                    <el-input placeholder="请输入唯一编码" v-model="parasDialogFormValue.Code"></el-input>
                </el-form-item>
                <el-form-item label="格式" prop="Format">
                    <el-select v-model="parasDialogFormValue.Format" class="w100" filterable @change="parasFormatChange">
                        <el-option
                            v-for="item of Object.keys(FORMAT_MAP)"
                            :key="item"
                            :label="FORMAT_MAP[item]"
                            :value="parseInt(item)"
                        ></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="参数值" prop="PValue">
                    <!-- æ–‡æœ¬ã€å¤šæ–‡æœ¬ã€æ•°å€¼ã€æ•´æ•°ã€é•¿æ•´æ•° -->
                    <el-input
                        v-if="INPUT_FORMAT.includes(parasDialogFormValue.Format)"
                        v-model="parasDialogFormValue.PValue"
                        v-bind="getInputProps(parasDialogFormValue.Format)"
                    ></el-input>
                    <!-- æ—¶é—´è¾“入(包括有 choice) -->
                    <el-date-picker
                        class="w100"
                        v-else-if="parasDialogFormValue.Format === PropertyFormatEnum.Time"
                        value-format="YYYY-MM-DD"
                        v-model="parasDialogFormValue.PValue"
                    >
                    </el-date-picker>
                    <!-- å¸ƒå°”值输入 -->
                    <el-radio-group
                        class="w100"
                        v-else-if="parasDialogFormValue.Format === PropertyFormatEnum.Boolean"
                        v-model="parasDialogFormValue.PValue"
                    >
                        <el-radio label="true" :value="true">是</el-radio>
                        <el-radio label="false" :value="false">否</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="说明" prop="Description">
                    <el-input placeholder="请输入说明" v-model="parasDialogFormValue.Description" type="textarea" :rows="3" />
                </el-form-item>
            </el-form>
            <template #footer>
                <div>
                    <el-button @click="closeParasDialog">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitParasFormValue">ç¡® å®š</el-button>
                </div>
            </template>
        </el-dialog>
        <ParentDialog
            v-model="parentDlgIsShow"
            :data="listTreeData"
            :api="parasGroupApi.UpdateBasicSysParasGroupTreeSortCode"
            :rowData="parentDlgMapRow"
            @submitSuccess="submitParentForm"
        >
        </ParentDialog>
    </div>
</template>
<script setup lang="ts">
import type { PropType } from 'vue';
import { ref, computed, onMounted, nextTick } from 'vue';
import LeftTreeByMgr from '/@/components/tree/leftTreeByMgr.vue';
import * as parasApi from '/@/api/basic/sys/sysParas';
import * as parasGroupApi from '/@/api/basic/sys/sysParasGroup';
import { FORMAT_MAP, PropertyFormatEnum, INPUT_FORMAT } from '/@/projectCom/basic/types';
import type { FormInstance, FormRules } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import { useQueryTable } from '/@/hooks/useQueryTable';
import { updateSort, useTableSort } from '/@/hooks/useTableSort';
import { useValidateUniqueness } from '/@/hooks/useValidateUniqueness';
import { deepClone } from '/@/utils/other';
import { EXTEND_TYPE_MAP } from '/@/projectCom/basic/types';
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
import ParentDialog from '/@/components/dialog/parentDialog/ParentDialog.vue';
import { arrayIsEmpty, convertListToTree, flatten } from '/@/utils/util';
import { booleanRegex, dateRegex, integerRegex, numberRegex } from '/@/utils/toolsValidate';
const props = defineProps({
    request: {
        type: Function as PropType<(config: AxiosRequestConfig<any>) => Promise<AxiosResponse<any, any>>>,
    },
});
//#region ====================== å·¦ä¾§æ ‘数据,tree init ======================
const leftTreeRef = ref(null);
const treeLoading = ref(false);
const listTreeData = ref([]);
const currentListID = ref('');
const currentNode = ref(null);
const handleClickNode = (data) => {
    nextTick(() => {
        leftTreeRef.value?.treeRef.setCurrentKey(data.ID);
    });
    currentListID.value = data.ID;
    currentNode.value = data;
    getTypeTableData();
};
const getListTreeData = async (selectFirst = false) => {
    treeLoading.value = true;
    const res = await parasGroupApi.GetAllBasicSysParasGroup(props.request).finally(() => {
        treeLoading.value = false;
    });
    if (res?.Code === 0) {
        listTreeData.value = convertListToTree(res.Data) || [];
        if (selectFirst) {
            const firstListTreeNode = listTreeData.value[0];
            if (firstListTreeNode) {
                handleClickNode(firstListTreeNode);
            } else {
                parasTableData.value = [];
                currentNode.value = null;
                currentListID.value = null;
            }
        } else {
            currentNode.value && handleClickNode(currentNode.value);
        }
    } else {
        ElMessage.error('获取分组失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
//#endregion
//#region ====================== èŽ·å–ã€åˆ é™¤è¡¨æ ¼æ•°æ® ======================
const parasTableLoading = ref(false);
const parasTableData = ref([]);
const isParasTableDrag = ref(false);
const getTypeTableData = async () => {
    parasTableLoading.value = true;
    const res = await parasApi.GetBasicSysParasByGroupID({ GroupID: currentListID.value }, props.request).finally(() => {
        parasTableLoading.value = false;
    });
    if (res?.Code === 0) {
        parasTableData.value = res.Data || [];
    } else {
        ElMessage.error('获取系统参数失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
const deleteCurrentTypeRow = (row: any) => {
    ElMessageBox.confirm(`确定删除系统参数:【${row.Name}】?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    }).then(async () => {
        const res = await parasApi.DeleteABasicSysParas(
            {
                ID: row.ID,
            },
            props.request
        );
        if (res?.Code === 0) {
            if (res.Data) {
                ElMessage.success('删除系统参数成功');
                getTypeTableData();
            } else {
                ElMessage.error('删除系统参数失败');
            }
        } else {
            ElMessage.error('删除系统参数失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    });
};
//#endregion
//#region ====================== æœç´¢è¡¨æ ¼ï¼Œå¯¹è¡¨æ ¼æŽ’序 ======================
const parasQueryParams = ref({
    Name: '',
    Code: '',
});
const { handleDragStatus: handleParasTableDrag, draggableTableRef: draggableTypeTableRef } = useTableSort(
    parasTableData,
    parasApi.UpdateBasicSysParasSorter,
    getTypeTableData,
    undefined,
    false,
    props.request
);
const {
    resetQuery: resetParasQuery,
    handleQueryTable: handleQueryParasTable,
    displayTableData: displayParasTableData,
} = useQueryTable(parasTableData, parasQueryParams, getTypeTableData);
//#endregion
//#region ====================== å¢žåŠ ã€ä¿®æ”¹è¡¨æ ¼è®°å½•æ“ä½œ, dialog init======================
const isEditTypeDialog = ref(false);
const parasDialogTitle = computed(() => {
    return isEditTypeDialog.value ? '修改系统参数' : '添加系统参数';
});
const parasDialogHeaderIcon = computed(() => {
    return isEditTypeDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const parasDialogFormValue = ref({
    Name: '',
    Code: '',
}) as any;
const parasDialogIsShow = ref(false);
const parasDialogFormRef = ref<FormInstance>(null);
const parasInitialCode = ref('');
const { uniquenessValidator: parasCodeValidator } = useValidateUniqueness(
    parasApi.GetIsExistBasicSysParasCode,
    parasInitialCode,
    '编码',
    'Code',
    undefined,
    false,
    props.request
);
const pValueValidator = (rule, value, callback) => {
    if (!value) {
        callback('必填项!');
    } else if (value && parasDialogFormValue.value.Format === PropertyFormatEnum.Numeric && !numberRegex.test(value)) {
        callback('请输入数字!');
    } else if (
        value &&
        [PropertyFormatEnum.Bigint, PropertyFormatEnum.Integer].includes(parasDialogFormValue.value.Format) &&
        !integerRegex.test(value)
    ) {
        callback('请输入整数!');
    } else if (value && PropertyFormatEnum.Time === parasDialogFormValue.value.Format && !dateRegex.test(value)) {
        callback('请输入正确的日期格式(yyyy-MM-dd HH:mm:ss æˆ– yyyy-MM-dd)');
    } else if (value && PropertyFormatEnum.Boolean === parasDialogFormValue.value.Format && !booleanRegex.test(value)) {
        callback('请输入 true æˆ– false');
    } else {
        callback();
    }
};
const parasDialogFormRules = ref<FormRules>({
    Name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
    Code: [{ required: true, validator: parasCodeValidator as any, trigger: 'blur' }],
    Format: [{ required: true, message: '请选择格式', trigger: 'change' }],
    PValue: [{ required: true, validator: pValueValidator as any, trigger: 'blur' }],
});
const openOperateParasDialog = (row?) => {
    if (!currentListID.value) {
        return ElMessage.warning('请先选择分组!');
    }
    if (row) {
        isEditTypeDialog.value = true;
        const { ID, Name, Code, Description, Format, PValue } = row;
        parasInitialCode.value = Code;
        parasDialogFormValue.value = deepClone({ ID, Name, Code, Description, Format, PValue });
    } else {
        isEditTypeDialog.value = false;
        parasInitialCode.value = '';
        parasDialogFormValue.value = {
            GroupID: currentListID.value,
            Name: '',
            Code: '',
            Description: '',
            Format: PropertyFormatEnum.Integer,
            PValue: '',
        };
    }
    parasDialogIsShow.value = true;
};
const closeParasDialog = () => {
    parasDialogIsShow.value = false;
    parasDialogFormRef.value.clearValidate();
};
const submitParasFormValue = async () => {
    const valid = await parasDialogFormRef.value.validate().catch(() => {});
    if (!valid) return;
    if (isEditTypeDialog.value) {
        const res = await parasApi.UpdateABasicSysParas(parasDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTypeTableData();
                parasDialogIsShow.value = false;
                ElMessage.success('修改系统参数成功');
            } else {
                ElMessage.error('修改系统参数失败');
            }
        } else {
            ElMessage.error('修改系统参数失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    } else {
        const res = await parasApi.InsertABasicSysParas(parasDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTypeTableData();
                parasDialogIsShow.value = false;
                ElMessage.success('添加系统参数成功');
            } else {
                ElMessage.error('添加系统参数失败');
            }
        } else {
            ElMessage.error('添加系统参数失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    }
};
//#endregion
//#region ====================== åˆ é™¤å·¦ä¾§æ ‘系统分组数据 ======================
const deleteCurrentGroup = (row: any) => {
    ElMessageBox.confirm(`确定删除系统分组:【${row.Name}】?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    }).then(async () => {
        const res = await parasGroupApi.DeleteABasicSysParasGroup(
            {
                ID: row.ID,
            },
            props.request
        );
        if (res?.Code === 0) {
            if (res.Data) {
                ElMessage.success('删除系统分组成功');
                getListTreeData(true);
            } else {
                ElMessage.error('删除系统分组失败');
            }
        } else {
            ElMessage.error('删除系统分组失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    });
};
//#endregion
//#region ====================== å¢žåŠ ã€åˆ é™¤ç³»ç»Ÿåˆ†ç»„æ“ä½œ, dialog init======================
const isEditGroupDialog = ref(false);
const groupDialogTitle = computed(() => {
    return isEditGroupDialog.value ? '修改系统分组' : '添加系统分组';
});
const groupDialogHeaderIcon = computed(() => {
    return isEditGroupDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const groupDialogFormValue = ref({
    Name: '',
    Code: '',
    Description: '',
}) as any;
const groupDialogIsShow = ref(false);
const groupDialogFormRef = ref<FormInstance>(null);
const groupDialogFormRules = ref<FormRules>({
    Name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
});
const openOperateGroupDialog = (data?) => {
    if (data) {
        isEditGroupDialog.value = true;
        const { ID, Name, Code, Description } = data;
        groupDialogFormValue.value = deepClone({ ID, Name, Code, Description });
    } else {
        isEditGroupDialog.value = false;
        groupDialogFormValue.value = { Name: '', Code: '', Description: '' };
    }
    groupDialogIsShow.value = true;
};
const closeGroupDialog = () => {
    groupDialogIsShow.value = false;
    groupDialogFormRef.value.clearValidate();
};
const submitGroupFormValue = async () => {
    const valid = await groupDialogFormRef.value.validate().catch(() => {});
    if (!valid) return;
    if (isEditGroupDialog.value) {
        const res = await parasGroupApi.UpdateABasicSysParasGroup(groupDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getListTreeData();
                groupDialogIsShow.value = false;
                ElMessage.success('修改系统分组成功');
            } else {
                ElMessage.error('修改系统分组失败');
            }
        } else {
            ElMessage.error('修改系统分组失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    } else {
        const res = await parasGroupApi.InsertABasicSysParasGroup(groupDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getListTreeData(arrayIsEmpty(listTreeData.value));
                groupDialogIsShow.value = false;
                ElMessage.success('添加系统分组成功');
            } else {
                ElMessage.error('添加系统分组失败');
            }
        } else {
            ElMessage.error('添加系统分组失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    }
};
//#endregion
//#region ====================== å·¦ä¾§æ ‘拖拽 ======================
const dragNodeEnd = async (draggingNode, dropNode, dropType, ev, originTreeData) => {
    updateSort(
        listTreeData,
        flatten(listTreeData.value),
        originTreeData,
        () => {
            handleClickNode(draggingNode.data);
            getListTreeData();
        },
        parasGroupApi.UpdateBasicSysParasGroupSorter,
        () => {
            handleClickNode(draggingNode.data);
        },
        undefined,
        props.request
    );
};
//#endregion
//#region ====================== æŒ‚载时获取初始数据 ======================
onMounted(() => {
    getListTreeData(true);
});
//#endregion
//#region ====================== ä¿®æ”¹çˆ¶çº§ ======================
const parentDlgIsShow = ref(false);
const parentDlgMapRow = ref(null);
const openParentDlg = (row?) => {
    parentDlgMapRow.value = row;
    parentDlgIsShow.value = true;
};
const submitParentForm = (res) => {
    getListTreeData();
};
//#endregion
const getInputProps = (format: PropertyFormatEnum) => {
    let inputProps = {};
    switch (format) {
        case PropertyFormatEnum.MultiText:
            inputProps = {
                type: 'textarea',
                row: 3,
            };
    }
    return {
        ...inputProps,
    } as any;
};
const parasFormatChange = () => {
    parasDialogFormValue.value.PValue = '';
};
</script>
<style scoped lang="scss"></style>
src/projectCom/basic/type/TypeManageCom.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,531 @@
<template>
    <!-- å·¦ä¾§åˆ†ç±»ç›®å½•树,上部表格操作 card,下部 table æ•°æ®å±•示 -->
    <div class="h100">
        <el-row :gutter="8" class="h100">
            <el-col :span="4" :xs="24" class="h100">
                <el-card shadow="hover" class="h100" v-loading="treeLoading">
                    <!-- ç›®å½•æ ‘ -->
                    <LeftTreeByMgr
                        class="h100 left-tree-card"
                        ref="leftTreeRef"
                        :treedata="listTreeData"
                        title-name="模块列表"
                        :show-more-operate="true"
                        :show-add="true"
                        :show-sorter="true"
                        :current-node-key="currentListID"
                        :node-icon="() => 'ele-Document'"
                        :tooltip="(_, data) => data.Code"
                        @click="handleClickNode"
                        @tree-edit="openOperateModuleDialog"
                        @tree-delete="deleteCurrentModule"
                        @tree-add="openOperateModuleDialog"
                        @node-drag-end="dragNodeEnd"
                    >
                    </LeftTreeByMgr>
                </el-card>
            </el-col>
            <el-col :span="20" :xs="24" class="flex-column h100">
                <el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
                    <!-- æŸ¥è¯¢ã€é‡ç½®ã€æŽ’序、增加表单 -->
                    <el-form :inline="true" :model="typeQueryParams">
                        <el-form-item label="名称" prop="Name">
                            <el-input v-model="typeQueryParams.Name" style="width: 226.4px" placeholder="名称" clearable></el-input>
                        </el-form-item>
                        <el-form-item label="编码" prop="Code">
                            <el-input v-model="typeQueryParams.Code" style="width: 226.4px" placeholder="编码" clearable />
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" icon="ele-Search" @click="handleQueryTypeTable"> æŸ¥è¯¢ </el-button>
                            <el-button icon="ele-Refresh" @click="resetTypeQuery">重置 </el-button>
                            <el-button icon="ele-Plus" @click="openOperateTypeDialog()"> å¢žåŠ  </el-button>
                        </el-form-item>
                        <el-form-item label="排序">
                            <el-switch
                                :disabled="displayTypeTableData !== typeTableData"
                                v-model="isTypeTableDrag"
                                @change="handleTypeTableDrag"
                                inline-prompt
                                active-icon="ele-Check"
                                inactive-icon="ele-Close"
                            >
                            </el-switch>
                        </el-form-item>
                    </el-form>
                </el-card>
                <el-card class="flex-auto scroll-table-card" shadow="hover" style="margin-top: 8px">
                    <!-- æ•°æ®å±•示表格 -->
                    <el-table
                        v-loading="typeTableLoading"
                        ref="draggableTypeTableRef"
                        border
                        row-key="ID"
                        :row-class-name="isTypeTableDrag ? 'cursor-move' : 'cursor-pointer'"
                        :cell-style="{ textAlign: 'center' }"
                        :header-cell-style="{ textAlign: 'center' }"
                        :data="displayTypeTableData"
                        style="width: 100%"
                        highlight-current-row
                    >
                        <el-table-column prop="Name" label="名称" fixed="left" show-overflow-tooltip />
                        <el-table-column prop="Code" label="编码" show-overflow-tooltip />
                        <el-table-column prop="ExtendType" label="拓展类型" align="center" show-overflow-tooltip>
                            <template #default="scope">
                                <el-tag>
                                    {{ EXTEND_TYPE_MAP[scope.row.ExtendType] }}
                                </el-tag>
                            </template>
                        </el-table-column>
                        <el-table-column prop="Description" label="说明" width="550" show-overflow-tooltip />
                        <el-table-column label="操作" fixed="right" show-overflow-tooltip>
                            <template #default="scope">
                                <el-button icon="ele-Edit" size="small" text type="primary" @click="openOperateTypeDialog(scope.row)">
                                    ç¼–辑
                                </el-button>
                                <el-button icon="ele-Delete" size="small" text type="danger" @click="deleteCurrentTypeRow(scope.row)">
                                    åˆ é™¤
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-card>
            </el-col>
        </el-row>
        <!-- å¢žåŠ ã€ä¿®æ”¹æ•°æ®å¯¹è¯æ¡† -->
        <el-dialog
            :destroy-on-close="true"
            v-model="moduleDialogIsShow"
            width="400"
            :close-on-click-modal="false"
            @closed="closeModuleDialog"
        >
            <template #header>
                <div style="color: #fff">
                    <SvgIcon :name="moduleDialogHeaderIcon" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                    <span> {{ moduleDialogTitle }} </span>
                </div>
            </template>
            <el-form :model="moduleDialogFormValue" ref="moduleDialogFormRef" :rules="moduleDialogFormRules" label-width="55">
                <el-form-item label="名称" prop="Name">
                    <el-input placeholder="请输入名称" v-model="moduleDialogFormValue.Name"></el-input>
                </el-form-item>
                <el-form-item label="编码" prop="Code">
                    <el-input placeholder="请输入唯一编码" v-model="moduleDialogFormValue.Code"></el-input>
                </el-form-item>
                <el-form-item label="说明" prop="Description">
                    <el-input placeholder="请输入说明" v-model="moduleDialogFormValue.Description" type="textarea" :rows="3" />
                </el-form-item>
            </el-form>
            <template #footer>
                <div>
                    <el-button @click="closeModuleDialog">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitModuleFormValue">ç¡® å®š</el-button>
                </div>
            </template>
        </el-dialog>
        <!-- å¢žåŠ ã€ä¿®æ”¹æ•°æ®å¯¹è¯æ¡† -->
        <el-dialog :destroy-on-close="true" v-model="typeDialogIsShow" width="400" :close-on-click-modal="false" @closed="closeTypeDialog">
            <template #header>
                <div style="color: #fff">
                    <SvgIcon :name="typeDialogHeaderIcon" :size="16" style="margin-right: 3px; display: inline; vertical-align: middle" />
                    <span> {{ typeDialogTitle }} </span>
                </div>
            </template>
            <el-form :model="typeDialogFormValue" ref="typeDialogFormRef" :rules="typeDialogFormRules" label-width="78">
                <el-form-item label="名称" prop="Name">
                    <el-input placeholder="请输入名称" v-model="typeDialogFormValue.Name"></el-input>
                </el-form-item>
                <el-form-item label="编码" prop="Code">
                    <el-input placeholder="请输入唯一编码" v-model="typeDialogFormValue.Code"></el-input>
                </el-form-item>
                <el-form-item label="拓展类型" prop="ExtendType">
                    <el-select placeholder="请选择拓展类型" v-model="typeDialogFormValue.ExtendType" class="w100" filterable>
                        <el-option
                            v-for="item of Object.keys(EXTEND_TYPE_MAP)"
                            :key="item"
                            :value="parseInt(item)"
                            :label="EXTEND_TYPE_MAP[item]"
                        ></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="说明" prop="Description">
                    <el-input placeholder="请输入说明" v-model="typeDialogFormValue.Description" type="textarea" :rows="3" />
                </el-form-item>
            </el-form>
            <template #footer>
                <div>
                    <el-button @click="closeTypeDialog">取 æ¶ˆ</el-button>
                    <el-button type="primary" @click="submitTypeFormValue">ç¡® å®š</el-button>
                </div>
            </template>
        </el-dialog>
    </div>
</template>
<script setup lang="ts">
import type { PropType } from 'vue';
import { computed, nextTick, onMounted, ref } from 'vue';
import LeftTreeByMgr from '/@/components/tree/leftTreeByMgr.vue';
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
import type { FormInstance, FormRules } from 'element-plus';
import { ElMessage, ElMessageBox } from 'element-plus';
import {
    // ç³»ç»Ÿæ¨¡å—
    DeleteAModule,
    // ç³»ç»Ÿç±»åž‹
    DeleteAType,
    GetAllModule,
    GetAllTypeByID,
    GetIsExistModuleCode,
    GetIsExistTypeCode,
    InsertAModule,
    InsertAType,
    UpdateAModule,
    UpdateAType,
    UpdateModuleSorter,
    UpdateTypeSorter,
} from '/@/api/basic/dataManage/typeManage';
import { useQueryTable } from '/@/hooks/useQueryTable';
import { updateSort, useTableSort } from '/@/hooks/useTableSort';
import { useValidateUniqueness } from '/@/hooks/useValidateUniqueness';
import { EXTEND_TYPE_MAP } from '/@/projectCom/basic/types';
import { deepClone } from '/@/utils/other';
const props = defineProps({
    request: {
        type: Function as PropType<(config: AxiosRequestConfig<any>) => Promise<AxiosResponse<any, any>>>,
    },
});
//#region ====================== å·¦ä¾§æ ‘数据,tree init ======================
const leftTreeRef = ref(null);
const treeLoading = ref(false);
const listTreeData = ref([]);
const currentListID = ref('');
const currentNode = ref(null);
const handleClickNode = (data) => {
    nextTick(() => {
        leftTreeRef.value?.treeRef.setCurrentKey(data.ID);
    });
    currentListID.value = data.ID;
    currentNode.value = data;
    getTypeTableData();
};
const getListTreeData = async (selectFirst = false) => {
    treeLoading.value = true;
    const res = await GetAllModule(props.request).finally(() => {
        treeLoading.value = false;
    });
    if (res?.Code === 0) {
        listTreeData.value = res.Data || [];
        if (selectFirst) {
            const firstListTreeNode = listTreeData.value[0];
            if (firstListTreeNode) {
                handleClickNode(firstListTreeNode);
            } else {
                typeTableData.value = [];
                currentNode.value = null;
                currentListID.value = null;
            }
        } else {
            currentNode.value && handleClickNode(currentNode.value);
        }
    } else {
        ElMessage.error('获取模块失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
//#endregion
//#region ====================== èŽ·å–ã€åˆ é™¤è¡¨æ ¼æ•°æ® ======================
const typeTableLoading = ref(false);
const typeTableData = ref([]);
const isTypeTableDrag = ref(false);
const getTypeTableData = async () => {
    typeTableLoading.value = true;
    const res = await GetAllTypeByID({ ModuleID: currentListID.value }, props.request).finally(() => {
        typeTableLoading.value = false;
    });
    if (res?.Code === 0) {
        typeTableData.value = res.Data || [];
    } else {
        ElMessage.error('获取系统类型失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
    }
};
const deleteCurrentTypeRow = (row: any) => {
    ElMessageBox.confirm(`确定删除系统类型:【${row.Name}】?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    }).then(async () => {
        const res = await DeleteAType(
            {
                ID: row.ID,
            },
            props.request
        );
        if (res?.Code === 0) {
            if (res.Data) {
                ElMessage.success('删除系统类型成功');
                getTypeTableData();
            } else {
                ElMessage.error('删除系统类型失败');
            }
        } else {
            ElMessage.error('删除系统类型失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    });
};
//#endregion
//#region ====================== æœç´¢è¡¨æ ¼ï¼Œå¯¹è¡¨æ ¼æŽ’序 ======================
const typeQueryParams = ref({
    Name: '',
    Code: '',
});
const { handleDragStatus: handleTypeTableDrag, draggableTableRef: draggableTypeTableRef } = useTableSort(
    typeTableData,
    UpdateTypeSorter,
    getTypeTableData,
    undefined,
    false,
    props.request
);
const {
    resetQuery: resetTypeQuery,
    handleQueryTable: handleQueryTypeTable,
    displayTableData: displayTypeTableData,
} = useQueryTable(typeTableData, typeQueryParams, getTypeTableData);
//#endregion
//#region ====================== å¢žåŠ ã€ä¿®æ”¹è¡¨æ ¼è®°å½•æ“ä½œ, dialog init======================
const isEditTypeDialog = ref(false);
const typeDialogTitle = computed(() => {
    return isEditTypeDialog.value ? '修改系统类型' : '添加系统类型';
});
const typeDialogHeaderIcon = computed(() => {
    return isEditTypeDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const typeDialogFormValue = ref({
    Name: '',
    Code: '',
}) as any;
const typeDialogIsShow = ref(false);
const typeDialogFormRef = ref<FormInstance>(null);
const typeInitialCode = ref('');
const { uniquenessValidator: typeCodeValidator } = useValidateUniqueness(
    GetIsExistTypeCode,
    typeInitialCode,
    '编码',
    'Code',
    undefined,
    false,
    props.request
);
const typeDialogFormRules = ref<FormRules>({
    Name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
    Code: [{ required: true, validator: typeCodeValidator as any, trigger: 'blur' }],
    ExtendType: [{ required: true, message: '请选择拓展类型', trigger: 'blur' }],
});
const openOperateTypeDialog = (row?) => {
    if (!currentListID.value) {
        return ElMessage.warning('请先选择模块!');
    }
    if (row) {
        isEditTypeDialog.value = true;
        const { ID, Name, Code, Description, ExtendType } = row;
        typeInitialCode.value = Code;
        typeDialogFormValue.value = deepClone({ ID, Name, Code, Description, ExtendType });
    } else {
        isEditTypeDialog.value = false;
        typeInitialCode.value = '';
        typeDialogFormValue.value = { ModuleID: currentListID.value, Name: '', Code: '', Description: '', ExtendType: null };
    }
    typeDialogIsShow.value = true;
};
const closeTypeDialog = () => {
    typeDialogIsShow.value = false;
    typeDialogFormRef.value.clearValidate();
};
const submitTypeFormValue = async () => {
    const valid = await typeDialogFormRef.value.validate().catch(() => {});
    if (!valid) return;
    if (isEditTypeDialog.value) {
        const res = await UpdateAType(typeDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTypeTableData();
                typeDialogIsShow.value = false;
                ElMessage.success('修改系统类型成功');
            } else {
                ElMessage.error('修改系统类型失败');
            }
        } else {
            ElMessage.error('修改系统类型失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    } else {
        const res = await InsertAType(typeDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getTypeTableData();
                typeDialogIsShow.value = false;
                ElMessage.success('添加系统类型成功');
            } else {
                ElMessage.error('添加系统类型失败');
            }
        } else {
            ElMessage.error('添加系统类型失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    }
};
//#endregion
//#region ====================== åˆ é™¤å·¦ä¾§æ ‘系统模块数据 ======================
const deleteCurrentModule = (row: any) => {
    ElMessageBox.confirm(`确定删除系统模块:【${row.Name}】?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
    }).then(async () => {
        const res = await DeleteAModule(
            {
                ID: row.ID,
            },
            props.request
        );
        if (res?.Code === 0) {
            if (res.Data) {
                ElMessage.success('删除系统模块成功');
                getListTreeData(true);
            } else {
                ElMessage.error('删除系统模块失败');
            }
        } else {
            ElMessage.error('删除系统模块失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    });
};
//#endregion
//#region ====================== å¢žåŠ ã€åˆ é™¤ç³»ç»Ÿæ¨¡å—æ“ä½œ, dialog init======================
const isEditModuleDialog = ref(false);
const moduleDialogTitle = computed(() => {
    return isEditModuleDialog.value ? '修改系统模块' : '添加系统模块';
});
const moduleDialogHeaderIcon = computed(() => {
    return isEditModuleDialog.value ? 'ele-Edit' : 'ele-Plus';
});
const moduleDialogFormValue = ref({
    Name: '',
    Code: '',
    Description: '',
}) as any;
const moduleDialogIsShow = ref(false);
const moduleDialogFormRef = ref<FormInstance>(null);
const moduleInitialCode = ref('');
const { uniquenessValidator: moduleCodeValidator } = useValidateUniqueness(
    GetIsExistModuleCode,
    moduleInitialCode,
    '编码',
    'Code',
    undefined,
    false,
    props.request
);
const moduleDialogFormRules = ref<FormRules>({
    Name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
    Code: [{ required: true, validator: moduleCodeValidator as any, trigger: 'blur' }],
});
const openOperateModuleDialog = (data?) => {
    if (data) {
        isEditModuleDialog.value = true;
        const { ID, Name, Code, Description } = data;
        moduleInitialCode.value = Code;
        moduleDialogFormValue.value = deepClone({ ID, Name, Code, Description });
    } else {
        isEditModuleDialog.value = false;
        moduleInitialCode.value = '';
        moduleDialogFormValue.value = { Name: '', Code: '', Description: '' };
    }
    moduleDialogIsShow.value = true;
};
const closeModuleDialog = () => {
    moduleDialogIsShow.value = false;
    moduleDialogFormRef.value.clearValidate();
};
const submitModuleFormValue = async () => {
    const valid = await moduleDialogFormRef.value.validate().catch(() => {});
    if (!valid) return;
    if (isEditModuleDialog.value) {
        const res = await UpdateAModule(moduleDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getListTreeData();
                moduleDialogIsShow.value = false;
                ElMessage.success('修改系统模块成功');
            } else {
                ElMessage.error('修改系统模块失败');
            }
        } else {
            ElMessage.error('修改系统模块失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    } else {
        const res = await InsertAModule(moduleDialogFormValue.value, props.request);
        if (res?.Code === 0) {
            if (res.Data) {
                getListTreeData();
                moduleDialogIsShow.value = false;
                ElMessage.success('添加系统模块成功');
            } else {
                ElMessage.error('添加系统模块失败');
            }
        } else {
            ElMessage.error('添加系统模块失败' + (res?.Message ? `,${JSON.stringify(res.Message)}` : ''));
        }
    }
};
//#endregion
//#region ====================== å·¦ä¾§æ ‘拖拽 ======================
const dragNodeEnd = async (draggingNode, dropNode, dropType, ev, originTreeData) => {
    updateSort(
        listTreeData,
        listTreeData.value,
        originTreeData,
        () => {
            handleClickNode(draggingNode.data);
            getListTreeData();
        },
        UpdateModuleSorter,
        () => {
            handleClickNode(draggingNode.data);
        },
        undefined,
        props.request
    );
};
//#endregion
//#region ====================== æŒ‚载时获取初始数据 ======================
onMounted(() => {
    getListTreeData(true);
});
//#endregion
</script>
<style scoped lang="scss"></style>
src/projectCom/basic/types.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,149 @@
export enum PropertyFormatEnum {
    // æ•´æ•°
    Integer = 1,
    // é•¿æ•´æ•°
    Bigint = 2,
    // æ•°å€¼
    Numeric = 3,
    // æ–‡æœ¬
    Text = 4,
    // å¤šæ–‡æœ¬
    MultiText = 5,
    // æ—¶é—´
    Time = 6,
    // å¸ƒå°”值
    Boolean = 7,
}
export const FORMAT_MAP = {
    [PropertyFormatEnum.Integer]: '整数',
    [PropertyFormatEnum.Bigint]: '长整数',
    [PropertyFormatEnum.Numeric]: '数值',
    [PropertyFormatEnum.Text]: '文本',
    [PropertyFormatEnum.MultiText]: '多文本',
    [PropertyFormatEnum.Time]: '时间',
    [PropertyFormatEnum.Boolean]: '布尔值',
} as const;
// ä½¿ç”¨ input ç»„ä»¶çš„ format
export const INPUT_FORMAT = [
    PropertyFormatEnum.Integer,
    PropertyFormatEnum.Bigint,
    PropertyFormatEnum.Numeric,
    PropertyFormatEnum.Text,
    PropertyFormatEnum.MultiText,
];
export enum ExtendTypeEnum {
    // æ— 
    None = 0,
    // å›ºæœ‰
    Innate = 1,
    // ç»§æ‰¿
    Inherit = 2,
}
export const EXTEND_TYPE_MAP = {
    [ExtendTypeEnum.None]: '无',
    [ExtendTypeEnum.Innate]: '固有',
    [ExtendTypeEnum.Inherit]: '继承',
};
export const enum CronTypeEnum {
    RealTime = 0,
    Hourly = 1,
    Daily = 2,
    Monthly = 3,
    Yearly = 4,
}
export const CRON_TYPE_MAP = {
    [CronTypeEnum.RealTime]: '实时',
    [CronTypeEnum.Hourly]: '每时',
    [CronTypeEnum.Daily]: '每日',
    [CronTypeEnum.Monthly]: '每月',
    [CronTypeEnum.Yearly]: '每年',
};
// æ¥æºç±»åž‹
export enum SourceTypeEnum {
    Docking = 0,
    Analyse = 1,
    Input = 2,
    Custom = 3,
}
export const SOURCE_TYPE_MAP = {
    [SourceTypeEnum.Docking]: '对接',
    [SourceTypeEnum.Analyse]: '分析',
    [SourceTypeEnum.Input]: '录入',
    [SourceTypeEnum.Custom]: '定制',
};
// è®¡é‡ç±»åž‹
export enum MeasureTypeEnum {
    Instant = 1,
    Accumulate = 2,
}
export const MEASURE_TYPE_MAP = {
    [MeasureTypeEnum.Instant]: '瞬时',
    [MeasureTypeEnum.Accumulate]: '累积',
};
export enum SignalTypeFormatEnum {
    // æ•°å€¼
    Numeric = 1,
    // æžšä¸¾
    Enumeration = 2,
    // é›†åˆ
    Collection = 3,
    // é›†æˆ
    Integration = 4,
    // æ–‡æœ¬
    Text = 5,
    // å›¾è°±
    Graph = 6,
}
// æ ¼å¼ç±»åž‹
export const formatTypeEnum = {
    [SignalTypeFormatEnum.Numeric]: '数值',
    [SignalTypeFormatEnum.Enumeration]: '枚举',
    [SignalTypeFormatEnum.Collection]: ' é›†åˆ',
    [SignalTypeFormatEnum.Integration]: '集成',
    [SignalTypeFormatEnum.Text]: ' æ–‡æœ¬',
    [SignalTypeFormatEnum.Graph]: ' å›¾è°±',
};
export type TreeProps = {
    id: string;
    label: string;
    children?: string;
};
export const enum TimeEnum {
    Second = 1,
    Minute = 2,
    Hour = 3,
    Day = 4,
}
export const timeEnumMap = {
    [TimeEnum.Day]: '天',
    [TimeEnum.Hour]: '小时',
    [TimeEnum.Minute]: '分钟',
    [TimeEnum.Second]: '秒',
};
export const timeEnumMapCount = {
    [TimeEnum.Day]: 3600 * 24,
    [TimeEnum.Hour]: 3600,
    [TimeEnum.Minute]: 60,
    [TimeEnum.Second]: 1,
};
src/projectCom/basic/unit/utils.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,19 @@
import type { Ref } from 'vue';
import { computed } from 'vue';
import type { TimeEnum } from '../types';
import { timeEnumMapCount } from '../types';
export const getComputedTime = (formValue: Ref<any>, timeProp: string, toType: Ref<TimeEnum>) => {
    const displayTimeData = computed({
        get: () => {
            return formValue.value?.[timeProp] && Number((formValue.value[timeProp] / timeEnumMapCount[toType.value]).toFixed(4));
        },
        set: (value) => {
            formValue.value[timeProp] = value && Number((value * timeEnumMapCount[toType.value]).toFixed(4));
        },
    });
    return displayTimeData
};