feat: 新功能开发,设备告警信息、设备实时数据查看等。
This commit is contained in:
@@ -222,7 +222,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DemoVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除测试单编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => (loading.value = false));
|
||||
await delDemo(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
|
||||
@@ -246,7 +246,7 @@ const submitForm = () => {
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row: TreeVO) => {
|
||||
await proxy?.$modal.confirm('是否确认删除测试树编号为"' + row.id + '"的数据项?');
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?');
|
||||
loading.value = true;
|
||||
await delTree(row.id).finally(() => (loading.value = false));
|
||||
await getList();
|
||||
|
||||
@@ -961,7 +961,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: AquUserVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除养殖账号编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => (loading.value = false));
|
||||
await delAquUser(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
|
||||
392
src/views/fishery/callNotice/index.vue
Normal file
392
src/views/fishery/callNotice/index.vue
Normal file
@@ -0,0 +1,392 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="100px">
|
||||
<el-form-item label="用户信息" prop="params.userKeyword">
|
||||
<el-input v-model="queryParams.params.userKeyword" placeholder="请输入用户名或手机号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备信息" prop="params.deviceKeyword">
|
||||
<el-input v-model="queryParams.params.deviceKeyword" placeholder="请输入设备名称或设备编号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类型" prop="params.deviceType">
|
||||
<el-select v-model="queryParams.params.deviceType" placeholder="请选择设备类型" clearable >
|
||||
<el-option v-for="dict in aqu_device_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="告警类型" prop="params.warnType">
|
||||
<el-select v-model="queryParams.params.warnType" placeholder="请选择告警类型" clearable >
|
||||
<el-option v-for="dict in warn_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="呼叫电话" prop="mobilePhone">
|
||||
<el-input v-model="queryParams.mobilePhone" placeholder="请输入呼叫电话" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="呼叫状态" prop="callStatus">
|
||||
<el-select v-model="queryParams.callStatus" placeholder="请选择呼叫状态" clearable >
|
||||
<el-option v-for="dict in call_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['fishery:callNotice:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['fishery:callNotice:edit']">修改</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['fishery:callNotice:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['fishery:callNotice:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="callNoticeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="用户名" align="center" prop="userName" width="120"/>
|
||||
<!-- <el-table-column label="手机号" align="center" prop="mobilePhone" width="120"/> -->
|
||||
<el-table-column label="设备编号" align="center" prop="serialNum" width="150"/>
|
||||
<!-- <el-table-column label="设备名称" align="center" prop="deviceName" width="120"/> -->
|
||||
<el-table-column label="设备类型" align="center" prop="deviceType" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="aqu_device_type" :value="scope.row.deviceType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="呼叫电话" align="center" prop="mobilePhone" width="120"/>
|
||||
<el-table-column label="呼叫时间" align="center" prop="callTime" width="180"/>
|
||||
<el-table-column label="告警类型" align="center" prop="warnType" width="150">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="warn_type" :value="scope.row.warnType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="告警标题" align="center" prop="warnTitle" width="100"/>
|
||||
<el-table-column label="呼叫状态" align="center" prop="callStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="call_status" :value="scope.row.callStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主叫号码" align="center" prop="caller" />
|
||||
<!-- <el-table-column label="呼叫发起时间" align="center" prop="originateTime" /> -->
|
||||
<!-- <el-table-column label="通话接通时间" align="center" prop="startTime" />
|
||||
<el-table-column label="通话结束时间" align="center" prop="endTime" /> -->
|
||||
<!-- <el-table-column label="通话时长" align="center" prop="duration" width="90">
|
||||
<template #default="scope">
|
||||
{{ scope.row.duration ? scope.row.duration + '秒' : '' }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- <el-table-column label="呼叫结果状态码" align="center" prop="statusCode" /> -->
|
||||
<el-table-column label="结果描述" align="center" prop="statusMsg" />
|
||||
<!-- <el-table-column label="通话类型" align="center" prop="tollType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="toll_type" :value="scope.row.tollType"/>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" align="center" width="80" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<!-- <el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['fishery:callNotice:edit']"></el-button>
|
||||
</el-tooltip> -->
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['fishery:callNotice:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改告警电话通知记录对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="callNoticeFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用户id" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="呼叫电话" prop="mobilePhone">
|
||||
<el-input v-model="form.mobilePhone" placeholder="请输入呼叫电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备id" prop="deviceId">
|
||||
<el-input v-model="form.deviceId" placeholder="请输入设备id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设定的呼叫时间" prop="callTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.callTime"
|
||||
type="datetime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="请选择设定的呼叫时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="呼叫的CallId" prop="callId">
|
||||
<el-input v-model="form.callId" placeholder="请输入呼叫的CallId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="呼叫状态" prop="callStatus">
|
||||
<el-select v-model="form.callStatus" placeholder="请选择呼叫状态">
|
||||
<el-option
|
||||
v-for="dict in call_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="主叫号码" prop="caller">
|
||||
<el-input v-model="form.caller" placeholder="请输入主叫号码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通话时长" prop="duration">
|
||||
<el-input v-model="form.duration" placeholder="请输入通话时长" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通话结束时间" prop="endTime">
|
||||
<el-input v-model="form.endTime" placeholder="请输入通话结束时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="挂断方向" prop="hangupDirection">
|
||||
<el-input v-model="form.hangupDirection" placeholder="请输入挂断方向" />
|
||||
</el-form-item>
|
||||
<el-form-item label="呼叫发起时间" prop="originateTime">
|
||||
<el-input v-model="form.originateTime" placeholder="请输入呼叫发起时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="扩展字段回传" prop="outId">
|
||||
<el-input v-model="form.outId" placeholder="请输入扩展字段回传" />
|
||||
</el-form-item>
|
||||
<el-form-item label="被叫响铃时间" prop="ringTime">
|
||||
<el-input v-model="form.ringTime" placeholder="请输入被叫响铃时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通话接通时间" prop="startTime">
|
||||
<el-input v-model="form.startTime" placeholder="请输入通话接通时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="呼叫结果状态码" prop="statusCode">
|
||||
<el-input v-model="form.statusCode" placeholder="请输入呼叫结果状态码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结果描述" prop="statusMsg">
|
||||
<el-input v-model="form.statusMsg" placeholder="请输入结果描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通话类型" prop="tollType">
|
||||
<el-select v-model="form.tollType" placeholder="请选择通话类型">
|
||||
<el-option
|
||||
v-for="dict in toll_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="话单类型" prop="voiceType">
|
||||
<el-select v-model="form.voiceType" placeholder="请选择话单类型">
|
||||
<el-option
|
||||
v-for="dict in voice_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="塘口名称" prop="pondName">
|
||||
<el-input v-model="form.pondName" placeholder="请输入塘口名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="CallNotice" lang="ts">
|
||||
import { listCallNotice, getCallNotice, delCallNotice, addCallNotice, updateCallNotice } from '@/api/fishery/callNotice';
|
||||
import { CallNoticeVO, CallNoticeQuery, CallNoticeForm } from '@/api/fishery/callNotice/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { toll_type, call_status, voice_type,aqu_device_type,warn_type } = toRefs<any>(proxy?.useDict('toll_type', 'call_status', 'voice_type','aqu_device_type','warn_type'));
|
||||
|
||||
const callNoticeList = ref<CallNoticeVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const callNoticeFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: CallNoticeForm = {
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
mobilePhone: undefined,
|
||||
deviceId: undefined,
|
||||
callTime: undefined,
|
||||
callId: undefined,
|
||||
callStatus: undefined,
|
||||
caller: undefined,
|
||||
duration: undefined,
|
||||
endTime: undefined,
|
||||
hangupDirection: undefined,
|
||||
originateTime: undefined,
|
||||
outId: undefined,
|
||||
ringTime: undefined,
|
||||
startTime: undefined,
|
||||
statusCode: undefined,
|
||||
statusMsg: undefined,
|
||||
tollType: undefined,
|
||||
voiceType: undefined,
|
||||
pondName: undefined,
|
||||
}
|
||||
const data = reactive<PageData<CallNoticeForm, CallNoticeQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: undefined,
|
||||
mobilePhone: undefined,
|
||||
deviceId: undefined,
|
||||
duration: undefined,
|
||||
endTime: undefined,
|
||||
hangupDirection: undefined,
|
||||
tollType: undefined,
|
||||
callStatus: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "主键id不能为空", trigger: "blur" }
|
||||
],
|
||||
userId: [
|
||||
{ required: true, message: "用户id不能为空", trigger: "blur" }
|
||||
],
|
||||
mobilePhone: [
|
||||
{ required: true, message: "呼叫电话不能为空", trigger: "blur" }
|
||||
],
|
||||
deviceId: [
|
||||
{ required: true, message: "设备id不能为空", trigger: "blur" }
|
||||
],
|
||||
callTime: [
|
||||
{ required: true, message: "设定的呼叫时间不能为空", trigger: "blur" }
|
||||
],
|
||||
callStatus: [
|
||||
{ required: true, message: "呼叫状态不能为空", trigger: "change" }
|
||||
],
|
||||
pondName: [
|
||||
{ required: true, message: "塘口名称不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询告警电话通知记录列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listCallNotice(queryParams.value);
|
||||
callNoticeList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
callNoticeFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: CallNoticeVO[]) => {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = "添加告警电话通知记录";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: CallNoticeVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0]
|
||||
const res = await getCallNotice(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改告警电话通知记录";
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
callNoticeFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateCallNotice(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addCallNotice(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: CallNoticeVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delCallNotice(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('fishery/callNotice/export', {
|
||||
...queryParams.value
|
||||
}, `callNotice_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
@@ -1207,7 +1207,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DeviceVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除设备管理编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delDevice(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
@@ -393,7 +393,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DeviceBindRecordVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除设备绑定记录编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delDeviceBindRecord(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
@@ -705,7 +705,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DeviceCorrectRecordVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除设备校准记录编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delDeviceCorrectRecord(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
@@ -497,7 +497,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DeviceErrorCodeVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除设备故障码编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delDeviceErrorCode(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
@@ -535,7 +535,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DeviceSwitchVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除测控一体机开关编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delDeviceSwitch(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
@@ -235,7 +235,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DeviceThresholdVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除设备阈值编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => (loading.value = false));
|
||||
await delDeviceThreshold(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
|
||||
@@ -291,7 +291,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DeviceWarnOneVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除设备报警明细编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delDeviceWarnOne(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
@@ -215,7 +215,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: FishVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除鱼类编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => (loading.value = false));
|
||||
await delFish(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
|
||||
@@ -456,7 +456,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: LinkedCtrlVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除溶解氧联动控制编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delLinkedCtrl(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
231
src/views/fishery/mapMessageWarnCallNotice/index.vue
Normal file
231
src/views/fishery/mapMessageWarnCallNotice/index.vue
Normal file
@@ -0,0 +1,231 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="告警消息Id" prop="messageWarnId">
|
||||
<el-input v-model="queryParams.messageWarnId" placeholder="请输入告警消息Id" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电话通知id" prop="callNoticeId">
|
||||
<el-input v-model="queryParams.callNoticeId" placeholder="请输入电话通知id" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['fishery:mapMessageWarnCallNotice:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['fishery:mapMessageWarnCallNotice:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['fishery:mapMessageWarnCallNotice:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['fishery:mapMessageWarnCallNotice:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="mapMessageWarnCallNoticeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="主键id" align="center" prop="id" v-if="true" />
|
||||
<el-table-column label="告警消息Id" align="center" prop="messageWarnId" />
|
||||
<el-table-column label="电话通知id" align="center" prop="callNoticeId" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['fishery:mapMessageWarnCallNotice:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['fishery:mapMessageWarnCallNotice:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改告警消息和电话告警通知关系表对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="mapMessageWarnCallNoticeFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="告警消息Id" prop="messageWarnId">
|
||||
<el-input v-model="form.messageWarnId" placeholder="请输入告警消息Id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="电话通知id" prop="callNoticeId">
|
||||
<el-input v-model="form.callNoticeId" placeholder="请输入电话通知id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MapMessageWarnCallNotice" lang="ts">
|
||||
import { listMapMessageWarnCallNotice, getMapMessageWarnCallNotice, delMapMessageWarnCallNotice, addMapMessageWarnCallNotice, updateMapMessageWarnCallNotice } from '@/api/fishery/mapMessageWarnCallNotice';
|
||||
import { MapMessageWarnCallNoticeVO, MapMessageWarnCallNoticeQuery, MapMessageWarnCallNoticeForm } from '@/api/fishery/mapMessageWarnCallNotice/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const mapMessageWarnCallNoticeList = ref<MapMessageWarnCallNoticeVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const mapMessageWarnCallNoticeFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: MapMessageWarnCallNoticeForm = {
|
||||
id: undefined,
|
||||
messageWarnId: undefined,
|
||||
callNoticeId: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
const data = reactive<PageData<MapMessageWarnCallNoticeForm, MapMessageWarnCallNoticeQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
messageWarnId: undefined,
|
||||
callNoticeId: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "主键id不能为空", trigger: "blur" }
|
||||
],
|
||||
messageWarnId: [
|
||||
{ required: true, message: "告警消息Id不能为空", trigger: "blur" }
|
||||
],
|
||||
callNoticeId: [
|
||||
{ required: true, message: "电话通知id不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询告警消息和电话告警通知关系表列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listMapMessageWarnCallNotice(queryParams.value);
|
||||
mapMessageWarnCallNoticeList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
mapMessageWarnCallNoticeFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: MapMessageWarnCallNoticeVO[]) => {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = "添加告警消息和电话告警通知关系表";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: MapMessageWarnCallNoticeVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0]
|
||||
const res = await getMapMessageWarnCallNotice(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改告警消息和电话告警通知关系表";
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
mapMessageWarnCallNoticeFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateMapMessageWarnCallNotice(form.value).finally(() => buttonLoading.value = false);
|
||||
} else {
|
||||
await addMapMessageWarnCallNotice(form.value).finally(() => buttonLoading.value = false);
|
||||
}
|
||||
proxy?.$modal.msgSuccess("操作成功");
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MapMessageWarnCallNoticeVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delMapMessageWarnCallNotice(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('fishery/mapMessageWarnCallNotice/export', {
|
||||
...queryParams.value
|
||||
}, `mapMessageWarnCallNotice_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
@@ -255,7 +255,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MessageOpRecordVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除用户操作记录编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delMessageOpRecord(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
405
src/views/fishery/messageWarn/index.vue
Normal file
405
src/views/fishery/messageWarn/index.vue
Normal file
@@ -0,0 +1,405 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="用户信息" prop="params.userKeyword">
|
||||
<el-input v-model="queryParams.params.userKeyword" placeholder="请输入用户名或手机号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备信息" prop="params.deviceKeyword">
|
||||
<el-input v-model="queryParams.params.deviceKeyword" placeholder="请输入设备名称或设备编号" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="告警类型" prop="warnType">
|
||||
<el-select v-model="queryParams.warnType" placeholder="请选择告警类型" clearable >
|
||||
<el-option v-for="dict in warn_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否已读" prop="isRead">
|
||||
<el-select v-model="queryParams.isRead" placeholder="请选择是否已读" clearable >
|
||||
<el-option v-for="dict in yes_no" :key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['fishery:messageWarn:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['fishery:messageWarn:edit']">修改</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['fishery:messageWarn:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['fishery:messageWarn:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="messageWarnList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="用户名" align="center" prop="userName" width="120"/>
|
||||
<el-table-column label="手机号" align="center" prop="mobilePhone" width="120"/>
|
||||
<el-table-column label="设备编号" align="center" prop="serialNum" width="150"/>
|
||||
<el-table-column label="设备名称" align="center" prop="deviceName" width="120"/>
|
||||
<!-- <el-table-column label="塘口名称" align="center" prop="pondName" width="120"/>-->
|
||||
<el-table-column label="告警标题" align="center" prop="title" width="100"/>
|
||||
<el-table-column label="告警类型" align="center" prop="warnType" width="150">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="warn_type" :value="scope.row.warnType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否已读" align="center" prop="isRead" width="90">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="yes_no" :value="scope.row.isRead"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="告警内容" align="center" prop="message" />
|
||||
<el-table-column label="电话通知次数" align="center" prop="callNoticeCount" width="120">
|
||||
<template #default="scope">
|
||||
<span
|
||||
v-if="scope.row.callNoticeCount > 0"
|
||||
style="color: #409eff; cursor: pointer; text-decoration: underline;"
|
||||
@click="handleViewCallNotice(scope.row)"
|
||||
>
|
||||
{{ scope.row.callNoticeCount }}
|
||||
</span>
|
||||
<span v-else>{{ scope.row.callNoticeCount || 0 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="告警时间" align="center" prop="createTime" width="160"/>
|
||||
<el-table-column label="操作" align="center" width="100" class-name="small-padding">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="查看" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['fishery:messageWarn:query']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['fishery:messageWarn:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 查看设备告警记录对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="600px" append-to-body>
|
||||
<el-form ref="messageWarnFormRef" :model="form" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户名">
|
||||
<el-input v-model="form.userName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="手机号">
|
||||
<el-input v-model="form.mobilePhone" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备编号">
|
||||
<el-input v-model="form.serialNum" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="设备名称">
|
||||
<el-input v-model="form.deviceName" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="告警类型">
|
||||
<el-select v-model="form.warnType" disabled style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in warn_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否已读">
|
||||
<el-select v-model="form.isRead" disabled style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in yes_no"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="塘口名称">
|
||||
<el-input v-model="form.pondName" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="告警标题">
|
||||
<el-input v-model="form.title" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="告警时间">
|
||||
<el-input v-model="form.createTime" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="告警内容">
|
||||
<el-input v-model="form.message" type="textarea" :rows="3" disabled />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancel">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 电话通知记录对话框 -->
|
||||
<el-dialog title="电话通知记录" v-model="callNoticeDialog.visible" width="1200px" append-to-body>
|
||||
<el-table v-loading="callNoticeDialog.loading" border :data="callNoticeList" max-height="400">
|
||||
<el-table-column label="通知手机号" align="center" prop="mobilePhone" width="120"/>
|
||||
<el-table-column label="呼叫时间" align="center" prop="createTime" width="180"/>
|
||||
<el-table-column label="告警类型" align="center" prop="warnType" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="warn_type" :value="scope.row.warnType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="告警标题" align="center" prop="warnTitle" width="120"/>
|
||||
<el-table-column label="呼叫状态" align="center" prop="callStatus" width="100">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="call_status" :value="scope.row.callStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主叫号码" align="center" prop="caller" width="120"/>
|
||||
<el-table-column label="通话时长" align="center" prop="duration" width="100">
|
||||
<template #default="scope">
|
||||
{{ scope.row.duration ? scope.row.duration + '秒' : '' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结果描述" align="center" prop="statusMsg" show-overflow-tooltip/>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="callNoticeTotal > 0"
|
||||
:total="callNoticeTotal"
|
||||
v-model:page="callNoticeQuery.pageNum"
|
||||
v-model:limit="callNoticeQuery.pageSize"
|
||||
@pagination="getCallNoticeList"
|
||||
/>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="callNoticeDialog.visible = false">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MessageWarn" lang="ts">
|
||||
import { listMessageWarn, getMessageWarn, delMessageWarn, addMessageWarn, updateMessageWarn } from '@/api/fishery/messageWarn';
|
||||
import { MessageWarnVO, MessageWarnQuery, MessageWarnForm } from '@/api/fishery/messageWarn/types';
|
||||
import { listCallNotice } from '@/api/fishery/callNotice';
|
||||
import { CallNoticeVO } from '@/api/fishery/callNotice/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { yes_no, warn_type, call_status } = toRefs<any>(proxy?.useDict('yes_no', 'warn_type', 'call_status'));
|
||||
|
||||
const messageWarnList = ref<MessageWarnVO[]>([]);
|
||||
const callNoticeList = ref<CallNoticeVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const callNoticeTotal = ref(0);
|
||||
|
||||
const callNoticeQuery = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
messageWarnId: undefined as string | number | undefined
|
||||
});
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const messageWarnFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const callNoticeDialog = reactive({
|
||||
visible: false,
|
||||
loading: false
|
||||
});
|
||||
|
||||
const initFormData: MessageWarnForm = {
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
deviceId: undefined,
|
||||
title: undefined,
|
||||
message: undefined,
|
||||
isRead: undefined,
|
||||
warnType: undefined,
|
||||
pondName: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
const data = reactive<PageData<MessageWarnForm, MessageWarnQuery>>({
|
||||
form: {...initFormData},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: undefined,
|
||||
deviceId: undefined,
|
||||
title: undefined,
|
||||
message: undefined,
|
||||
isRead: undefined,
|
||||
warnType: undefined,
|
||||
pondName: undefined,
|
||||
params: {
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
id: [
|
||||
{ required: true, message: "主键id不能为空", trigger: "blur" }
|
||||
],
|
||||
userId: [
|
||||
{ required: true, message: "用户id不能为空", trigger: "blur" }
|
||||
],
|
||||
deviceId: [
|
||||
{ required: true, message: "设备id不能为空", trigger: "blur" }
|
||||
],
|
||||
title: [
|
||||
{ required: true, message: "告警标题不能为空", trigger: "blur" }
|
||||
],
|
||||
message: [
|
||||
{ required: true, message: "告警内容不能为空", trigger: "blur" }
|
||||
],
|
||||
isRead: [
|
||||
{ required: true, message: "是否已读不能为空", trigger: "change" }
|
||||
],
|
||||
warnType: [
|
||||
{ required: true, message: "告警类型不能为空", trigger: "change" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询设备告警记录列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listMessageWarn(queryParams.value);
|
||||
messageWarnList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
}
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = {...initFormData};
|
||||
messageWarnFormRef.value?.resetFields();
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: MessageWarnVO[]) => {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = "添加设备告警记录";
|
||||
}
|
||||
|
||||
/** 查看按钮操作 */
|
||||
const handleView = async (row: MessageWarnVO) => {
|
||||
reset();
|
||||
const res = await getMessageWarn(row.id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = "查看告警详情";
|
||||
}
|
||||
|
||||
/** 查看电话通知记录 */
|
||||
const handleViewCallNotice = async (row: MessageWarnVO) => {
|
||||
callNoticeQuery.messageWarnId = row.id;
|
||||
callNoticeQuery.pageNum = 1;
|
||||
callNoticeDialog.visible = true;
|
||||
await getCallNoticeList();
|
||||
}
|
||||
|
||||
/** 获取电话通知记录列表 */
|
||||
const getCallNoticeList = async () => {
|
||||
callNoticeDialog.loading = true;
|
||||
try {
|
||||
const res = await listCallNotice({
|
||||
pageNum: callNoticeQuery.pageNum,
|
||||
pageSize: callNoticeQuery.pageSize,
|
||||
params: {
|
||||
messageWarnId: callNoticeQuery.messageWarnId
|
||||
}
|
||||
});
|
||||
callNoticeList.value = res.rows;
|
||||
callNoticeTotal.value = res.total;
|
||||
} finally {
|
||||
callNoticeDialog.loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MessageWarnVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delMessageWarn(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download('fishery/messageWarn/export', {
|
||||
...queryParams.value
|
||||
}, `messageWarn_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
@@ -652,7 +652,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: PayDeviceVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除设备充值记录编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delPayDevice(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
@@ -852,7 +852,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: PondVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除塘口编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => (loading.value = false));
|
||||
await delPond(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
|
||||
@@ -205,7 +205,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: TecentUserCacheVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除公众号用户缓存编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delTecentUserCache(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
@@ -445,7 +445,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: TimingCtrlVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除开关定时控制编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delTimingCtrl(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
@@ -212,7 +212,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: UserRelationVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除养殖用户子账号编号为"' + _ids + '"的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await delUserRelation(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
await getList();
|
||||
|
||||
@@ -281,7 +281,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: ClientVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除客户端管理编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => (loading.value = false));
|
||||
await delClient(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
|
||||
@@ -234,7 +234,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: ConfigVO) => {
|
||||
const configIds = row?.configId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?');
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?');
|
||||
await delConfig(configIds);
|
||||
await getList();
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
|
||||
@@ -218,7 +218,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DictTypeVO) => {
|
||||
const dictIds = row?.dictId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?');
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?');
|
||||
await delType(dictIds);
|
||||
getList();
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
|
||||
@@ -255,7 +255,7 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: NoticeVO) => {
|
||||
const noticeIds = row?.noticeId || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除公告编号为"' + noticeIds + '"的数据项?');
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?');
|
||||
await delNotice(noticeIds);
|
||||
await getList();
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
|
||||
Reference in New Issue
Block a user