diff --git a/public/config/config.json b/public/config/config.json index a85fc42..29161c3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -10,5 +10,5 @@ "maxZoom": "13", "zoom": "10", "timeGap": 3000, - "systemType": "sm" + "systemType": "gm" } diff --git a/public/config/config.json b/public/config/config.json index a85fc42..29161c3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -10,5 +10,5 @@ "maxZoom": "13", "zoom": "10", "timeGap": 3000, - "systemType": "sm" + "systemType": "gm" } diff --git a/src/api/alarm/dangerAssessment/manage.ts b/src/api/alarm/dangerAssessment/manage.ts new file mode 100644 index 0000000..dae1056 --- /dev/null +++ b/src/api/alarm/dangerAssessment/manage.ts @@ -0,0 +1,50 @@ +/** + * 安全生产隐患管理 + */ +import request from '../../index' + +// 获取列表 +export function getDangerAssessmentManageList(data: any) { + return request({ + url: 'risk/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getDangerAssessmentManageDetail(data: { id: string }) { + return request({ + url: 'risk/detail', + method: 'get', + params: data, + }) +} + +// 新增 +export function addDangerAssessmentManage(data: object) { + return request({ + url: 'risk/add', + method: 'post', + data, + }) +} + +// 编辑 +export function updateDangerAssessmentManage(data: object) { + return request({ + url: 'risk/update', + method: 'post', + data, + }) +} + +// 批量导入 +export function batchImport(data: object) { + return request({ + url: 'risk/batchImport', + method: 'post', + data, + }) +} + diff --git a/public/config/config.json b/public/config/config.json index a85fc42..29161c3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -10,5 +10,5 @@ "maxZoom": "13", "zoom": "10", "timeGap": 3000, - "systemType": "sm" + "systemType": "gm" } diff --git a/src/api/alarm/dangerAssessment/manage.ts b/src/api/alarm/dangerAssessment/manage.ts new file mode 100644 index 0000000..dae1056 --- /dev/null +++ b/src/api/alarm/dangerAssessment/manage.ts @@ -0,0 +1,50 @@ +/** + * 安全生产隐患管理 + */ +import request from '../../index' + +// 获取列表 +export function getDangerAssessmentManageList(data: any) { + return request({ + url: 'risk/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getDangerAssessmentManageDetail(data: { id: string }) { + return request({ + url: 'risk/detail', + method: 'get', + params: data, + }) +} + +// 新增 +export function addDangerAssessmentManage(data: object) { + return request({ + url: 'risk/add', + method: 'post', + data, + }) +} + +// 编辑 +export function updateDangerAssessmentManage(data: object) { + return request({ + url: 'risk/update', + method: 'post', + data, + }) +} + +// 批量导入 +export function batchImport(data: object) { + return request({ + url: 'risk/batchImport', + method: 'post', + data, + }) +} + diff --git a/src/api/alarm/policyConfig/monitorPoint.ts b/src/api/alarm/policyConfig/monitorPoint.ts new file mode 100644 index 0000000..e4cd648 --- /dev/null +++ b/src/api/alarm/policyConfig/monitorPoint.ts @@ -0,0 +1,68 @@ +/** + * 监控点位管理 + */ +import request from '../../index' + +// 获取列表 +export function getMonitorPointList(data: any) { + return request({ + url: 'device/relation/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getMonitorPointDetail(data: { id: string }) { + return request({ + url: 'device/relation/detail', + method: 'get', + params: data, + }) +} + +// 编辑 +export function updateMonitorPoint(data: object) { + return request({ + url: 'device/relation/update', + method: 'post', + data, + }) +} + +// 获取盒子列表 +export function getBoxList(data: any) { + return request({ + url: 'device/box/list', + method: 'get', + params: data, + }) +} + +// 获取算法列表 +export function getModelList(data: any) { + return request({ + url: 'device/model/list', + method: 'get', + params: data, + }) +} + +// 获取算法-场景对象列表 +export function getSceneList(data: any) { + return request({ + url: 'scene/list', + method: 'get', + params: data, + }) +} + +// 算法报警对象 +export function getRecognitionList(data: any) { + return request({ + url: 'device/recognitionType/recognitionList', + method: 'get', + params: data, + }) +} + diff --git a/public/config/config.json b/public/config/config.json index a85fc42..29161c3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -10,5 +10,5 @@ "maxZoom": "13", "zoom": "10", "timeGap": 3000, - "systemType": "sm" + "systemType": "gm" } diff --git a/src/api/alarm/dangerAssessment/manage.ts b/src/api/alarm/dangerAssessment/manage.ts new file mode 100644 index 0000000..dae1056 --- /dev/null +++ b/src/api/alarm/dangerAssessment/manage.ts @@ -0,0 +1,50 @@ +/** + * 安全生产隐患管理 + */ +import request from '../../index' + +// 获取列表 +export function getDangerAssessmentManageList(data: any) { + return request({ + url: 'risk/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getDangerAssessmentManageDetail(data: { id: string }) { + return request({ + url: 'risk/detail', + method: 'get', + params: data, + }) +} + +// 新增 +export function addDangerAssessmentManage(data: object) { + return request({ + url: 'risk/add', + method: 'post', + data, + }) +} + +// 编辑 +export function updateDangerAssessmentManage(data: object) { + return request({ + url: 'risk/update', + method: 'post', + data, + }) +} + +// 批量导入 +export function batchImport(data: object) { + return request({ + url: 'risk/batchImport', + method: 'post', + data, + }) +} + diff --git a/src/api/alarm/policyConfig/monitorPoint.ts b/src/api/alarm/policyConfig/monitorPoint.ts new file mode 100644 index 0000000..e4cd648 --- /dev/null +++ b/src/api/alarm/policyConfig/monitorPoint.ts @@ -0,0 +1,68 @@ +/** + * 监控点位管理 + */ +import request from '../../index' + +// 获取列表 +export function getMonitorPointList(data: any) { + return request({ + url: 'device/relation/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getMonitorPointDetail(data: { id: string }) { + return request({ + url: 'device/relation/detail', + method: 'get', + params: data, + }) +} + +// 编辑 +export function updateMonitorPoint(data: object) { + return request({ + url: 'device/relation/update', + method: 'post', + data, + }) +} + +// 获取盒子列表 +export function getBoxList(data: any) { + return request({ + url: 'device/box/list', + method: 'get', + params: data, + }) +} + +// 获取算法列表 +export function getModelList(data: any) { + return request({ + url: 'device/model/list', + method: 'get', + params: data, + }) +} + +// 获取算法-场景对象列表 +export function getSceneList(data: any) { + return request({ + url: 'scene/list', + method: 'get', + params: data, + }) +} + +// 算法报警对象 +export function getRecognitionList(data: any) { + return request({ + url: 'device/recognitionType/recognitionList', + method: 'get', + params: data, + }) +} + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 04b39cc..92165e1 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -40,7 +40,7 @@ default: 'default', }, // 输入框大小 }) -const emit = defineEmits(['update:modelValue']) +const emit = defineEmits(['update:modelValue', 'changeDept']) // ------------定义props参数---------- const value = computed({ get() { @@ -153,6 +153,10 @@ return [] } } + +const changeDept = (val: any) => { + emit('changeDept', val) +} // --------暴露方法 defineExpose({ refreshTree, fetchDeptTree, findChildren }) @@ -176,6 +180,7 @@ filterable class="full-width-input" :disabled="props.disabled" + @change="changeDept" /> diff --git a/public/config/config.json b/public/config/config.json index a85fc42..29161c3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -10,5 +10,5 @@ "maxZoom": "13", "zoom": "10", "timeGap": 3000, - "systemType": "sm" + "systemType": "gm" } diff --git a/src/api/alarm/dangerAssessment/manage.ts b/src/api/alarm/dangerAssessment/manage.ts new file mode 100644 index 0000000..dae1056 --- /dev/null +++ b/src/api/alarm/dangerAssessment/manage.ts @@ -0,0 +1,50 @@ +/** + * 安全生产隐患管理 + */ +import request from '../../index' + +// 获取列表 +export function getDangerAssessmentManageList(data: any) { + return request({ + url: 'risk/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getDangerAssessmentManageDetail(data: { id: string }) { + return request({ + url: 'risk/detail', + method: 'get', + params: data, + }) +} + +// 新增 +export function addDangerAssessmentManage(data: object) { + return request({ + url: 'risk/add', + method: 'post', + data, + }) +} + +// 编辑 +export function updateDangerAssessmentManage(data: object) { + return request({ + url: 'risk/update', + method: 'post', + data, + }) +} + +// 批量导入 +export function batchImport(data: object) { + return request({ + url: 'risk/batchImport', + method: 'post', + data, + }) +} + diff --git a/src/api/alarm/policyConfig/monitorPoint.ts b/src/api/alarm/policyConfig/monitorPoint.ts new file mode 100644 index 0000000..e4cd648 --- /dev/null +++ b/src/api/alarm/policyConfig/monitorPoint.ts @@ -0,0 +1,68 @@ +/** + * 监控点位管理 + */ +import request from '../../index' + +// 获取列表 +export function getMonitorPointList(data: any) { + return request({ + url: 'device/relation/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getMonitorPointDetail(data: { id: string }) { + return request({ + url: 'device/relation/detail', + method: 'get', + params: data, + }) +} + +// 编辑 +export function updateMonitorPoint(data: object) { + return request({ + url: 'device/relation/update', + method: 'post', + data, + }) +} + +// 获取盒子列表 +export function getBoxList(data: any) { + return request({ + url: 'device/box/list', + method: 'get', + params: data, + }) +} + +// 获取算法列表 +export function getModelList(data: any) { + return request({ + url: 'device/model/list', + method: 'get', + params: data, + }) +} + +// 获取算法-场景对象列表 +export function getSceneList(data: any) { + return request({ + url: 'scene/list', + method: 'get', + params: data, + }) +} + +// 算法报警对象 +export function getRecognitionList(data: any) { + return request({ + url: 'device/recognitionType/recognitionList', + method: 'get', + params: data, + }) +} + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 04b39cc..92165e1 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -40,7 +40,7 @@ default: 'default', }, // 输入框大小 }) -const emit = defineEmits(['update:modelValue']) +const emit = defineEmits(['update:modelValue', 'changeDept']) // ------------定义props参数---------- const value = computed({ get() { @@ -153,6 +153,10 @@ return [] } } + +const changeDept = (val: any) => { + emit('changeDept', val) +} // --------暴露方法 defineExpose({ refreshTree, fetchDeptTree, findChildren }) @@ -176,6 +180,7 @@ filterable class="full-width-input" :disabled="props.disabled" + @change="changeDept" /> diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index d1f5b24..e3d6460 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -8,5 +8,6 @@ filter?: Function // 字段过滤器 styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 + required?: boolean // 是否必填 } diff --git a/public/config/config.json b/public/config/config.json index a85fc42..29161c3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -10,5 +10,5 @@ "maxZoom": "13", "zoom": "10", "timeGap": 3000, - "systemType": "sm" + "systemType": "gm" } diff --git a/src/api/alarm/dangerAssessment/manage.ts b/src/api/alarm/dangerAssessment/manage.ts new file mode 100644 index 0000000..dae1056 --- /dev/null +++ b/src/api/alarm/dangerAssessment/manage.ts @@ -0,0 +1,50 @@ +/** + * 安全生产隐患管理 + */ +import request from '../../index' + +// 获取列表 +export function getDangerAssessmentManageList(data: any) { + return request({ + url: 'risk/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getDangerAssessmentManageDetail(data: { id: string }) { + return request({ + url: 'risk/detail', + method: 'get', + params: data, + }) +} + +// 新增 +export function addDangerAssessmentManage(data: object) { + return request({ + url: 'risk/add', + method: 'post', + data, + }) +} + +// 编辑 +export function updateDangerAssessmentManage(data: object) { + return request({ + url: 'risk/update', + method: 'post', + data, + }) +} + +// 批量导入 +export function batchImport(data: object) { + return request({ + url: 'risk/batchImport', + method: 'post', + data, + }) +} + diff --git a/src/api/alarm/policyConfig/monitorPoint.ts b/src/api/alarm/policyConfig/monitorPoint.ts new file mode 100644 index 0000000..e4cd648 --- /dev/null +++ b/src/api/alarm/policyConfig/monitorPoint.ts @@ -0,0 +1,68 @@ +/** + * 监控点位管理 + */ +import request from '../../index' + +// 获取列表 +export function getMonitorPointList(data: any) { + return request({ + url: 'device/relation/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getMonitorPointDetail(data: { id: string }) { + return request({ + url: 'device/relation/detail', + method: 'get', + params: data, + }) +} + +// 编辑 +export function updateMonitorPoint(data: object) { + return request({ + url: 'device/relation/update', + method: 'post', + data, + }) +} + +// 获取盒子列表 +export function getBoxList(data: any) { + return request({ + url: 'device/box/list', + method: 'get', + params: data, + }) +} + +// 获取算法列表 +export function getModelList(data: any) { + return request({ + url: 'device/model/list', + method: 'get', + params: data, + }) +} + +// 获取算法-场景对象列表 +export function getSceneList(data: any) { + return request({ + url: 'scene/list', + method: 'get', + params: data, + }) +} + +// 算法报警对象 +export function getRecognitionList(data: any) { + return request({ + url: 'device/recognitionType/recognitionList', + method: 'get', + params: data, + }) +} + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 04b39cc..92165e1 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -40,7 +40,7 @@ default: 'default', }, // 输入框大小 }) -const emit = defineEmits(['update:modelValue']) +const emit = defineEmits(['update:modelValue', 'changeDept']) // ------------定义props参数---------- const value = computed({ get() { @@ -153,6 +153,10 @@ return [] } } + +const changeDept = (val: any) => { + emit('changeDept', val) +} // --------暴露方法 defineExpose({ refreshTree, fetchDeptTree, findChildren }) @@ -176,6 +180,7 @@ filterable class="full-width-input" :disabled="props.disabled" + @change="changeDept" /> diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index d1f5b24..e3d6460 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -8,5 +8,6 @@ filter?: Function // 字段过滤器 styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 + required?: boolean // 是否必填 } diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts index 31a16b9..fb5f8ac 100644 --- a/src/utils/useCheckList.ts +++ b/src/utils/useCheckList.ts @@ -1,5 +1,4 @@ import { ElMessage } from 'element-plus' -import type { TableColumn } from '@/components/NormalTable/table_interface' /** * 检查列表 @@ -7,13 +6,14 @@ * @param columns // 表头信息 * @param tableTitle // 表格名称 */ -export function useCheckList(list: { [key: string]: string }[], columns: TableColumn, tableTitle = '') { +export function useCheckList(list: { [key: string]: string }[], columns: any, tableTitle = '') { for (let index = 0; index < list.length; index++) { const item = list[index] for (const prop of columns) { // 检查必填 if (prop.required && !item[prop.value]) { - ElMessage.warning(`请先完善${tableTitle}第${index + 1}行中${prop.text}`) + // ElMessage.warning(`请先完善${tableTitle}第${index + 1}行中${prop.text}`) + ElMessage.warning(`请先完善${tableTitle}中【${item.typeName}】的${prop.text}`) return false } // 验证正则 diff --git a/public/config/config.json b/public/config/config.json index a85fc42..29161c3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -10,5 +10,5 @@ "maxZoom": "13", "zoom": "10", "timeGap": 3000, - "systemType": "sm" + "systemType": "gm" } diff --git a/src/api/alarm/dangerAssessment/manage.ts b/src/api/alarm/dangerAssessment/manage.ts new file mode 100644 index 0000000..dae1056 --- /dev/null +++ b/src/api/alarm/dangerAssessment/manage.ts @@ -0,0 +1,50 @@ +/** + * 安全生产隐患管理 + */ +import request from '../../index' + +// 获取列表 +export function getDangerAssessmentManageList(data: any) { + return request({ + url: 'risk/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getDangerAssessmentManageDetail(data: { id: string }) { + return request({ + url: 'risk/detail', + method: 'get', + params: data, + }) +} + +// 新增 +export function addDangerAssessmentManage(data: object) { + return request({ + url: 'risk/add', + method: 'post', + data, + }) +} + +// 编辑 +export function updateDangerAssessmentManage(data: object) { + return request({ + url: 'risk/update', + method: 'post', + data, + }) +} + +// 批量导入 +export function batchImport(data: object) { + return request({ + url: 'risk/batchImport', + method: 'post', + data, + }) +} + diff --git a/src/api/alarm/policyConfig/monitorPoint.ts b/src/api/alarm/policyConfig/monitorPoint.ts new file mode 100644 index 0000000..e4cd648 --- /dev/null +++ b/src/api/alarm/policyConfig/monitorPoint.ts @@ -0,0 +1,68 @@ +/** + * 监控点位管理 + */ +import request from '../../index' + +// 获取列表 +export function getMonitorPointList(data: any) { + return request({ + url: 'device/relation/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getMonitorPointDetail(data: { id: string }) { + return request({ + url: 'device/relation/detail', + method: 'get', + params: data, + }) +} + +// 编辑 +export function updateMonitorPoint(data: object) { + return request({ + url: 'device/relation/update', + method: 'post', + data, + }) +} + +// 获取盒子列表 +export function getBoxList(data: any) { + return request({ + url: 'device/box/list', + method: 'get', + params: data, + }) +} + +// 获取算法列表 +export function getModelList(data: any) { + return request({ + url: 'device/model/list', + method: 'get', + params: data, + }) +} + +// 获取算法-场景对象列表 +export function getSceneList(data: any) { + return request({ + url: 'scene/list', + method: 'get', + params: data, + }) +} + +// 算法报警对象 +export function getRecognitionList(data: any) { + return request({ + url: 'device/recognitionType/recognitionList', + method: 'get', + params: data, + }) +} + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 04b39cc..92165e1 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -40,7 +40,7 @@ default: 'default', }, // 输入框大小 }) -const emit = defineEmits(['update:modelValue']) +const emit = defineEmits(['update:modelValue', 'changeDept']) // ------------定义props参数---------- const value = computed({ get() { @@ -153,6 +153,10 @@ return [] } } + +const changeDept = (val: any) => { + emit('changeDept', val) +} // --------暴露方法 defineExpose({ refreshTree, fetchDeptTree, findChildren }) @@ -176,6 +180,7 @@ filterable class="full-width-input" :disabled="props.disabled" + @change="changeDept" /> diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index d1f5b24..e3d6460 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -8,5 +8,6 @@ filter?: Function // 字段过滤器 styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 + required?: boolean // 是否必填 } diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts index 31a16b9..fb5f8ac 100644 --- a/src/utils/useCheckList.ts +++ b/src/utils/useCheckList.ts @@ -1,5 +1,4 @@ import { ElMessage } from 'element-plus' -import type { TableColumn } from '@/components/NormalTable/table_interface' /** * 检查列表 @@ -7,13 +6,14 @@ * @param columns // 表头信息 * @param tableTitle // 表格名称 */ -export function useCheckList(list: { [key: string]: string }[], columns: TableColumn, tableTitle = '') { +export function useCheckList(list: { [key: string]: string }[], columns: any, tableTitle = '') { for (let index = 0; index < list.length; index++) { const item = list[index] for (const prop of columns) { // 检查必填 if (prop.required && !item[prop.value]) { - ElMessage.warning(`请先完善${tableTitle}第${index + 1}行中${prop.text}`) + // ElMessage.warning(`请先完善${tableTitle}第${index + 1}行中${prop.text}`) + ElMessage.warning(`请先完善${tableTitle}中【${item.typeName}】的${prop.text}`) return false } // 验证正则 diff --git a/src/views/alarm/dangerAssessment/manage/editPointDialog.vue b/src/views/alarm/dangerAssessment/manage/editPointDialog.vue new file mode 100644 index 0000000..db4b29f --- /dev/null +++ b/src/views/alarm/dangerAssessment/manage/editPointDialog.vue @@ -0,0 +1,219 @@ + + + + + + diff --git a/public/config/config.json b/public/config/config.json index a85fc42..29161c3 100644 --- a/public/config/config.json +++ b/public/config/config.json @@ -10,5 +10,5 @@ "maxZoom": "13", "zoom": "10", "timeGap": 3000, - "systemType": "sm" + "systemType": "gm" } diff --git a/src/api/alarm/dangerAssessment/manage.ts b/src/api/alarm/dangerAssessment/manage.ts new file mode 100644 index 0000000..dae1056 --- /dev/null +++ b/src/api/alarm/dangerAssessment/manage.ts @@ -0,0 +1,50 @@ +/** + * 安全生产隐患管理 + */ +import request from '../../index' + +// 获取列表 +export function getDangerAssessmentManageList(data: any) { + return request({ + url: 'risk/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getDangerAssessmentManageDetail(data: { id: string }) { + return request({ + url: 'risk/detail', + method: 'get', + params: data, + }) +} + +// 新增 +export function addDangerAssessmentManage(data: object) { + return request({ + url: 'risk/add', + method: 'post', + data, + }) +} + +// 编辑 +export function updateDangerAssessmentManage(data: object) { + return request({ + url: 'risk/update', + method: 'post', + data, + }) +} + +// 批量导入 +export function batchImport(data: object) { + return request({ + url: 'risk/batchImport', + method: 'post', + data, + }) +} + diff --git a/src/api/alarm/policyConfig/monitorPoint.ts b/src/api/alarm/policyConfig/monitorPoint.ts new file mode 100644 index 0000000..e4cd648 --- /dev/null +++ b/src/api/alarm/policyConfig/monitorPoint.ts @@ -0,0 +1,68 @@ +/** + * 监控点位管理 + */ +import request from '../../index' + +// 获取列表 +export function getMonitorPointList(data: any) { + return request({ + url: 'device/relation/listPage', + method: 'get', + params: data, + }) +} + +// 详情 +export function getMonitorPointDetail(data: { id: string }) { + return request({ + url: 'device/relation/detail', + method: 'get', + params: data, + }) +} + +// 编辑 +export function updateMonitorPoint(data: object) { + return request({ + url: 'device/relation/update', + method: 'post', + data, + }) +} + +// 获取盒子列表 +export function getBoxList(data: any) { + return request({ + url: 'device/box/list', + method: 'get', + params: data, + }) +} + +// 获取算法列表 +export function getModelList(data: any) { + return request({ + url: 'device/model/list', + method: 'get', + params: data, + }) +} + +// 获取算法-场景对象列表 +export function getSceneList(data: any) { + return request({ + url: 'scene/list', + method: 'get', + params: data, + }) +} + +// 算法报警对象 +export function getRecognitionList(data: any) { + return request({ + url: 'device/recognitionType/recognitionList', + method: 'get', + params: data, + }) +} + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 04b39cc..92165e1 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -40,7 +40,7 @@ default: 'default', }, // 输入框大小 }) -const emit = defineEmits(['update:modelValue']) +const emit = defineEmits(['update:modelValue', 'changeDept']) // ------------定义props参数---------- const value = computed({ get() { @@ -153,6 +153,10 @@ return [] } } + +const changeDept = (val: any) => { + emit('changeDept', val) +} // --------暴露方法 defineExpose({ refreshTree, fetchDeptTree, findChildren }) @@ -176,6 +180,7 @@ filterable class="full-width-input" :disabled="props.disabled" + @change="changeDept" /> diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index d1f5b24..e3d6460 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -8,5 +8,6 @@ filter?: Function // 字段过滤器 styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 + required?: boolean // 是否必填 } diff --git a/src/utils/useCheckList.ts b/src/utils/useCheckList.ts index 31a16b9..fb5f8ac 100644 --- a/src/utils/useCheckList.ts +++ b/src/utils/useCheckList.ts @@ -1,5 +1,4 @@ import { ElMessage } from 'element-plus' -import type { TableColumn } from '@/components/NormalTable/table_interface' /** * 检查列表 @@ -7,13 +6,14 @@ * @param columns // 表头信息 * @param tableTitle // 表格名称 */ -export function useCheckList(list: { [key: string]: string }[], columns: TableColumn, tableTitle = '') { +export function useCheckList(list: { [key: string]: string }[], columns: any, tableTitle = '') { for (let index = 0; index < list.length; index++) { const item = list[index] for (const prop of columns) { // 检查必填 if (prop.required && !item[prop.value]) { - ElMessage.warning(`请先完善${tableTitle}第${index + 1}行中${prop.text}`) + // ElMessage.warning(`请先完善${tableTitle}第${index + 1}行中${prop.text}`) + ElMessage.warning(`请先完善${tableTitle}中【${item.typeName}】的${prop.text}`) return false } // 验证正则 diff --git a/src/views/alarm/dangerAssessment/manage/editPointDialog.vue b/src/views/alarm/dangerAssessment/manage/editPointDialog.vue new file mode 100644 index 0000000..db4b29f --- /dev/null +++ b/src/views/alarm/dangerAssessment/manage/editPointDialog.vue @@ -0,0 +1,219 @@ + + + + + + diff --git a/src/views/alarm/dangerAssessment/manage/list.vue b/src/views/alarm/dangerAssessment/manage/list.vue index a1b6214..3e27450 100644 --- a/src/views/alarm/dangerAssessment/manage/list.vue +++ b/src/views/alarm/dangerAssessment/manage/list.vue @@ -5,61 +5,112 @@ import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' import type { IList, IListQuery } from './manage-interface' // import EditDialog from './editDialog.vue' +import editPointDialog from './editPointDialog.vue' import type { TableColumn } from '@/components/NormalTable/table_interface' import { uploadApi } from '@/api/monitor/dev' import { getDictByCode } from '@/api/system/dict' +import ButtonBox from '@/components/buttonBox/buttonBox.vue' +import type { IMenu } from '@/components/buttonBox/buttonBox' import type { dictType } from '@/global' +import { getDangerAssessmentManageList } from '@/api/alarm/dangerAssessment/manage' const { proxy } = getCurrentInstance() as any const editDialogRef = ref() // 组件 const router = useRouter() // 文件上传input const fileRef = ref() const loading = ref(false) +const menu = ref([]) // 审批状态按钮组合 +const active = ref('') // 右上方按钮 +// ------------------------------------------------------------------------------------------ // 默认查询条件 const listQuery: Ref = ref({ area: '', // 所属区域 - deptId: '', // 所属区域 - dangerCategory: '', // 隐患分类 - startTime: '', // 开始时间 - endTime: '', // 结束时间 + deptId: '', // 所属组织 + riskName: '', // 危险点名称 + riskType: '', // 危险点类型 offset: 1, limit: 20, }) -// 表格表头 -const columns: Ref = ref([ - { text: '所属区域', value: 'area', align: 'center' }, +// ------------------------------------------表头--------------------------------------------- +const columns: Ref = ref([]) // 表头 +// 危险点 +const columnsPoint: TableColumn[] = [ { text: '所属单位', value: 'deptName', align: 'center' }, - { text: '业务内容', value: 'businessContent', align: 'center' }, - { text: '隐患分类Ⅰ', value: 'yhfl1', align: 'center' }, - { text: '隐患分类Ⅱ', value: 'yhfl2', align: 'center' }, - { text: '监控相机', value: 'equipmentName', align: 'center' }, - { text: '录入时间', value: 'time', align: 'center' }, - { text: '备注', value: 'remark', align: 'center' }, -]) + { text: '危险点名称', value: 'riskName', align: 'center' }, + { text: '详细地址', value: 'address', align: 'center' }, + { text: '作业活动概述', value: 'content', align: 'center' }, + { text: '危险性质', value: 'nature', align: 'center' }, + { text: '等级', value: 'grade', align: 'center' }, + { text: '定岗', value: 'assignPost', align: 'center' }, + { text: '定员', value: 'staffQuota', align: 'center' }, + { text: '危险物质及定量', value: 'substancesQuantities', align: 'center' }, +] +// 重大危险源 +const columnsSource: TableColumn[] = [ + { text: '所属单位', value: 'deptName', align: 'center' }, + { text: '危险源名称', value: 'businessContent', align: 'center' }, + { text: '场所级别', value: 'yhfl1', align: 'center' }, + { text: '危险化学品名称', value: 'yhfl2', align: 'center' }, + { text: '危险性质', value: 'equipmentName', align: 'center' }, + { text: '存量', value: 'time', align: 'center' }, + { text: '临界量', value: 'remark', align: 'center' }, + { text: '分级指数', value: 'remark', align: 'center' }, + { text: '危险物质及定量', value: 'remark', align: 'center' }, + { text: '危险源等级', value: 'remark', align: 'center' }, +] +// 危险化学品场所 +const columnsChemistry: TableColumn[] = [ + { text: '所属单位', value: 'deptName', align: 'center' }, + { text: '危险化学品场所', value: 'businessContent', align: 'center' }, + { text: '场所分类', value: 'yhfl1', align: 'center' }, + { text: '作业活动', value: 'yhfl2', align: 'center' }, + { text: '危化品名称', value: 'equipmentName', align: 'center' }, + { text: '危险性质', value: 'time', align: 'center' }, + { text: '定岗', value: 'remark', align: 'center' }, + { text: '定员', value: 'remark', align: 'center' }, + { text: '定量', value: 'remark', align: 'center' }, + { text: '定寿命', value: 'remark', align: 'center' }, + { text: '定检', value: 'remark', align: 'center' }, +] +// 危险作业 +const columnsWork: TableColumn[] = [ + { text: '所属单位', value: 'deptName', align: 'center' }, + { text: '危险作业', value: 'businessContent', align: 'center' }, + { text: '危险作业等级', value: 'yhfl1', align: 'center' }, + { text: '主要危险描述', value: 'yhfl2', align: 'center' }, + { text: '相关部门', value: 'equipmentName', align: 'center' }, + { text: '作业频次', value: 'time', align: 'center' }, +] +// 危险作业工序 +const columnsWorkProcesses: TableColumn[] = [ + { text: '所属单位', value: 'deptName', align: 'center' }, + { text: '危险作业工序', value: 'businessContent', align: 'center' }, + { text: '作业人员数量', value: 'yhfl1', align: 'center' }, + { text: '事故类型', value: 'yhfl2', align: 'center' }, +] +// ------------------------------------------------------------------------------------------- const total = ref(0) // 数据条数 -const list = ref([]) // 数据条数 -const checkoutList = ref([]) // 数据条数 -// 开始结束时间 -const datetimerange = ref() -watch(() => datetimerange.value, (newVal) => { - listQuery.value.startTime = '' - listQuery.value.endTime = '' - if (Array.isArray(newVal)) { - if (newVal.length) { - listQuery.value.startTime = `${newVal[0]} 00:00:00` - listQuery.value.endTime = `${newVal[1]} 23:59:59` +const list = ref([]) // 数据条数 +const checkoutList = ref([]) // 数据条数 + +const editPointDialogRef = ref() // 危险点ref +// -----------------------------------------字典-------------------------------------------------------------- +// 查询字典 +const getDict = async () => { + // 审批状态 + const res = await getDictByCode('dangerAssessmentType') + // 制作右上角的菜单 + const tempMenu = ['重大危险源', '危险点', '危险化学品场所', '危险作业', '危险作业工序'] + tempMenu.forEach((item) => { + const tempFindData = res.data.find((e: { name: string; value: string }) => e.name === item) + if (tempFindData) { + menu.value.push({ + name: tempFindData.name, + id: `${tempFindData.value}`, + }) } - } -}) -// ------------------------------------字典------------------------------------------ -// const statusList = ref([]) // 在线状态 -const getDict = () => { - // // 在线状态 - // getDictByCode('status').then((response) => { - // statusList.value = response.data - // }) + }) } -getDict() // -----------------------------------文件上传------------------------------------------- // 点击批量导入 const batchImport = () => { @@ -101,34 +152,12 @@ // 查询数据 const fetchData = () => { loading.value = true - // getDevListPage(listQuery).then((res: { data: { rows: []; total: number } }) => { - // list.value = res.data.rows - // total.value = res.data.total - // loading.value = false - // }) - list.value = [{ - id: '1', - area: '测试数据1', // 设备名称 - deptName: '测试数据1', // 设备编号 - businessContent: '测试数据1', // 所属单位 - yhfl1: '测试数据1', // RTSP地址 - yhfl2: '测试数据1', // 识别间隔 - equipmentName: '测试数据1', // 告警间隔 - time: '2021-11-11', - remark: '测试数据1', // 业务场景 - }, - { - id: '2', - area: '测试数据2', // 设备名称 - deptName: '测试数据2', // 设备编号 - businessContent: '测试数据2', // 所属单位 - yhfl1: '测试数据2', // RTSP地址 - yhfl2: '测试数据2', // 识别间隔 - equipmentName: '测试数据2', // 告警间隔 - time: '2022-09-08', - remark: '测试数据2', // 业务场景 - }, - ] + listQuery.value.riskType = active.value // 危险点类型 + getDangerAssessmentManageList(listQuery.value).then((res: { data: { rows: []; total: number } }) => { + list.value = res.data.rows + total.value = res.data.total + loading.value = false + }) loading.value = false } @@ -136,14 +165,12 @@ const reset = () => { listQuery.value = { area: '', // 所属区域 - deptId: '', // 所属区域 - dangerCategory: '', // 隐患分类 - startTime: '', // 开始时间 - endTime: '', // 结束时间 + deptId: '', // 所属组织 + riskName: '', // 危险点名称 + riskType: '', // 危险点类型 offset: 1, limit: 20, } - datetimerange.value = [] fetchData() } @@ -154,17 +181,57 @@ // 新增 const add = (row: IList) => { - ElMessage.info('敬请期待') + switch (active.value) { + case '1': // 危险点 + editPointDialogRef.value.initDialog('add') + break + case '2': // 重大危险源 + break + case '3': // 危险化学品场所 + break + case '4': // 危险作业 + break + case '5': // 危险作业工序 + break + } // editDialogRef.value.initDialog('add') } // 详情 const detail = (row: IList) => { - editDialogRef.value.initDialog('detail', row) + switch (active.value) { + case '1': // 危险点 + editPointDialogRef.value.initDialog('detail', row) + break + case '2': // 重大危险源 + break + case '3': // 危险化学品场所 + break + case '4': // 危险作业 + break + case '5': // 危险作业工序 + break + } +} +// 编辑 +const edit = (row: IList) => { + switch (active.value) { + case '1': // 危险点 + editPointDialogRef.value.initDialog('edit', row) + break + case '2': // 重大危险源 + break + case '3': // 危险化学品场所 + break + case '4': // 危险作业 + break + case '5': // 危险作业工序 + break + } } // 删除 const del = (row: IList) => { ElMessageBox.confirm( - `确定要删除${row.equipmentName}吗?`, + '确定删除吗?', '确认删除', { confirmButtonText: '确定', @@ -191,7 +258,39 @@ fetchData() } -onMounted(() => { +// 切换tab状态 +const changeCurrentButton = (val: string) => { + active.value = val + reset() +} + +watch(() => active.value, (newValue) => { + console.log(newValue) + switch (newValue) { + case '1': // 危险点 + columns.value = columnsPoint + break + case '2': // 重大危险源 + columns.value = columnsSource + break + case '3': // 危险化学品场所 + columns.value = columnsChemistry + break + case '4': // 危险作业 + columns.value = columnsWork + break + case '5': // 危险作业工序 + columns.value = columnsWorkProcesses + break + default: + columns.value = columnsPoint + break + } +}, { immediate: true }) + +onMounted(async () => { + await getDict() + active.value = '1' fetchData() }) @@ -200,19 +299,10 @@ - + - - - - - - - + @@ -222,12 +312,22 @@ + + + +