From 682e437d248c62fcde89a6892f4f7323878b182d Mon Sep 17 00:00:00 2001 From: wwp <782568523@qq.com> Date: Wed, 17 Jul 2024 13:57:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SafeCampus.WEB/src/api/modules/warn/zjrq.ts | 4 + .../monitor/live/components/moveForm.vue | 106 ++++++++++++++++++ .../src/views/monitor/live/index.vue | 34 ++---- SafeCampus.WEB/src/views/warn/zjrq/index.vue | 87 +++++++++++++- 4 files changed, 201 insertions(+), 30 deletions(-) create mode 100644 SafeCampus.WEB/src/views/monitor/live/components/moveForm.vue diff --git a/SafeCampus.WEB/src/api/modules/warn/zjrq.ts b/SafeCampus.WEB/src/api/modules/warn/zjrq.ts index 49a5f93..f975120 100644 --- a/SafeCampus.WEB/src/api/modules/warn/zjrq.ts +++ b/SafeCampus.WEB/src/api/modules/warn/zjrq.ts @@ -38,6 +38,10 @@ const warnZJRQApi = { warnGroup(params: ReqId) { return http.get("getInfo", params); }, + /** 获取告警分组 */ + warnType(params: ReqId) { + return http.get("getAlarmType", params); + }, }; export { warnZJRQApi }; diff --git a/SafeCampus.WEB/src/views/monitor/live/components/moveForm.vue b/SafeCampus.WEB/src/views/monitor/live/components/moveForm.vue new file mode 100644 index 0000000..6a6f1c9 --- /dev/null +++ b/SafeCampus.WEB/src/views/monitor/live/components/moveForm.vue @@ -0,0 +1,106 @@ + + + + + + diff --git a/SafeCampus.WEB/src/views/monitor/live/index.vue b/SafeCampus.WEB/src/views/monitor/live/index.vue index 3b7b71e..e6d16b1 100644 --- a/SafeCampus.WEB/src/views/monitor/live/index.vue +++ b/SafeCampus.WEB/src/views/monitor/live/index.vue @@ -58,7 +58,7 @@ :disabled="!scope.isSelected" @click="onDelete(scope.selectedListIds, '删除所选数据')" /> - 移动至分组 + 移动至分组 - + +
@@ -139,6 +140,7 @@ import { useDictStore } from "@/stores/modules"; import Form from "./components/form.vue"; import userForm from "./components/userForm.vue"; + import moveForm from "./components/moveForm.vue"; import { FormOptEnum, SysDictEnum, MenuTypeDictEnum } from "@/enums"; // import './aliyun-rts-sdk.js' import './ali.js' @@ -291,29 +293,13 @@ const remove = (node: Node, data: Tree) => { await useHandleData(monitorLIVEApi.delete, { ids }, msg); RefreshTable(); } - async function move(ids: string[], msg: string) { - return new Promise((resolve, reject) => { - ElMessageBox.confirm(`是否${msg}?`, "温馨提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: 'warning', - draggable: true - }) - .then(async () => { - // const res = await api(params); - // if (!res) return reject(false); - // ElMessage({ - // type: "success", - // message: `${message}成功!` - // }); - resolve(true); - }) - .catch(() => { - //啥也不干 - }); - }) - } + + + const moveFormRef = ref | null>(null); + function omMove(opt: FormOptEnum, record: {} | SysOrg.SysOrgInfo = {}) { + moveFormRef.value?.omMove({ opt: opt, record: record, successful: RefreshTable }); +} /** * 刷新表格 */ diff --git a/SafeCampus.WEB/src/views/warn/zjrq/index.vue b/SafeCampus.WEB/src/views/warn/zjrq/index.vue index 5acb962..be69a3d 100644 --- a/SafeCampus.WEB/src/views/warn/zjrq/index.vue +++ b/SafeCampus.WEB/src/views/warn/zjrq/index.vue @@ -110,7 +110,28 @@ import { ColumnProps, ProTableInstance } from "@/components/ProTable/interface"; import { useDictStore } from "@/stores/modules"; import { FormOptEnum, SysDictEnum, MenuTypeDictEnum } from "@/enums"; const visible = ref(false); //是否显示表单 - +onMounted(() => { + getWarnTypeList(); +}); +let warnOptions = ref([]); +function getWarnTypeList() { + setTimeout(async ()=> { + await warnZJRQApi.warnType({}).then(res => { + let { code, data } = res; + + if (code == 200) { + warnOptions.value = data.map(item => { + return { + label: item.name, + value: item.code + }; + }) + + } + }); + }) + +} // 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数) const proTable = ref(); const dictStore = useDictStore(); @@ -118,7 +139,7 @@ const dictStore = useDictStore(); // 表格配置项 const columns: ColumnProps[] = [ { type: "selection", fixed: "left", width: 80 }, - { prop: "searchKey", label: "关键字", search: { el: "input" }, isShow: false }, + // { prop: "searchKey", label: "关键字", search: { el: "input" }, isShow: false }, // { prop: "cameraId", label: "所属摄像头", search: { el: "input" }, isShow: false }, // { prop: "alarmTypeDesc", label: "告警类型", search: { el: "input" }, isShow: false }, { @@ -151,21 +172,75 @@ const columns: ColumnProps[] = [ } }, { - prop: "alarmTypeDesc", - label: "告警类型" + prop: "alarmType", + label: "告警类型", + enum: warnOptions, + search: { + el: "tree-select", + // span: 1 + } }, { prop: "warnHand", label: "处理状态", + enum: [ + { + label: "已处理", + value: 1 + }, + { + label: "未处理", + value: 0 + } + ], render: scope => { if (scope.row.warnHand === 1) { return "已处理"; } else { return "未处理"; } - } + }, + search: { + el: "tree-select", + // span: 1 + } }, - { prop: "tick", label: "预警时间" }, + { + prop: "tick", + label: "预警时间", + search: { + // 自定义 search 组件 + span: 1, + render: ({ searchParam }) => { + return ( +
+ + - + +
+ ); + } + } + + }, { prop: "operation", label: "操作", width: 250, fixed: "right" } ];