fix: 设备管理,删除改成解绑。
This commit is contained in:
@@ -27,10 +27,10 @@
|
||||
<el-tabs v-model="activeDeviceType" @tab-change="handleTabChange" class="mb-4">
|
||||
<el-tab-pane label="全部" :name="0">
|
||||
</el-tab-pane>
|
||||
<el-tab-pane
|
||||
v-for="dict in aqu_device_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
<el-tab-pane
|
||||
v-for="dict in aqu_device_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:name="parseInt(dict.value)">
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@@ -43,7 +43,7 @@
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['fishery:device:edit']">修改</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['fishery:device:remove']">删除</el-button>
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['fishery:device:remove']">解绑</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['fishery:device:export']">导出</el-button>
|
||||
@@ -92,8 +92,8 @@
|
||||
<!-- <el-table-column label="相位差" align="center" prop="phaseDifference" /> -->
|
||||
<el-table-column label="参比值" align="center" prop="treference" />
|
||||
<el-table-column label="荧光值" align="center" prop="tfluorescence" />
|
||||
|
||||
|
||||
|
||||
|
||||
<el-table-column label="溶解氧电话告警开关" align="center" prop="oxyWarnCallOpen" width="120" >
|
||||
<template #default="scope">
|
||||
<dict-tag :options="open_close" :value="scope.row.oxyWarnCallOpen"/>
|
||||
@@ -153,9 +153,9 @@
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['fishery:device:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<!-- <el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['fishery:device:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</el-tooltip> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -168,10 +168,10 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户" prop="userId">
|
||||
<el-input
|
||||
:value="selectedUser ? `${selectedUser.userName} (${selectedUser.mobilePhone})` : ''"
|
||||
placeholder="请选择用户"
|
||||
readonly
|
||||
<el-input
|
||||
:value="selectedUser ? `${selectedUser.userName} (${selectedUser.mobilePhone})` : ''"
|
||||
placeholder="请选择用户"
|
||||
readonly
|
||||
:disabled="!!form.id"
|
||||
style="cursor: pointer;"
|
||||
@click="openUserSelect"
|
||||
@@ -184,10 +184,10 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="塘口" prop="pondId">
|
||||
<el-input
|
||||
:value="selectedPond ? selectedPond.pondName : ''"
|
||||
placeholder="请选择塘口"
|
||||
readonly
|
||||
<el-input
|
||||
:value="selectedPond ? selectedPond.pondName : ''"
|
||||
placeholder="请选择塘口"
|
||||
readonly
|
||||
:disabled="!!form.id"
|
||||
style="cursor: pointer;"
|
||||
@click="openPondSelect"
|
||||
@@ -440,25 +440,25 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 用户选择对话框 -->
|
||||
<el-dialog title="选择用户" v-model="userSelectVisible" width="900px" append-to-body>
|
||||
<!-- 搜索条件 -->
|
||||
<el-form :model="userQueryParams" :inline="true" class="mb-4">
|
||||
<el-form-item label="用户名">
|
||||
<el-input
|
||||
v-model="userQueryParams.userName"
|
||||
placeholder="请输入用户名"
|
||||
clearable
|
||||
<el-input
|
||||
v-model="userQueryParams.userName"
|
||||
placeholder="请输入用户名"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
@keyup.enter="handleUserQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号">
|
||||
<el-input
|
||||
v-model="userQueryParams.mobilePhone"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
<el-input
|
||||
v-model="userQueryParams.mobilePhone"
|
||||
placeholder="请输入手机号"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
@keyup.enter="handleUserQuery"
|
||||
/>
|
||||
@@ -468,10 +468,10 @@
|
||||
<el-button icon="Refresh" @click="resetUserQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
<!-- 用户表格 -->
|
||||
<el-table
|
||||
:data="aquUserList"
|
||||
<el-table
|
||||
:data="aquUserList"
|
||||
highlight-current-row
|
||||
height="400px"
|
||||
border
|
||||
@@ -483,9 +483,9 @@
|
||||
<el-table-column label="区县" align="center" prop="district" />
|
||||
<el-table-column label="操作" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handleUserSelect(scope.row)"
|
||||
>
|
||||
选择
|
||||
@@ -493,42 +493,42 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
v-show="userTotal > 0"
|
||||
:total="userTotal"
|
||||
v-model:page="userQueryParams.pageNum"
|
||||
v-model:limit="userQueryParams.pageSize"
|
||||
<pagination
|
||||
v-show="userTotal > 0"
|
||||
:total="userTotal"
|
||||
v-model:page="userQueryParams.pageNum"
|
||||
v-model:limit="userQueryParams.pageSize"
|
||||
@pagination="handleUserPaginationChange"
|
||||
class="mt-4"
|
||||
/>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancelUserSelect">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 塘口选择对话框 -->
|
||||
<el-dialog title="选择塘口" v-model="pondSelectVisible" width="1000px" append-to-body>
|
||||
<!-- 搜索条件 -->
|
||||
<el-form :model="pondQueryParams" :inline="true" class="mb-4">
|
||||
<el-form-item label="塘口名称">
|
||||
<el-input
|
||||
v-model="pondQueryParams.pondName"
|
||||
placeholder="请输入塘口名称"
|
||||
clearable
|
||||
<el-input
|
||||
v-model="pondQueryParams.pondName"
|
||||
placeholder="请输入塘口名称"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
@keyup.enter="handlePondQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户信息">
|
||||
<el-input
|
||||
v-model="pondQueryParams.params.userKeyword"
|
||||
placeholder="请输入用户名或手机号"
|
||||
clearable
|
||||
<el-input
|
||||
v-model="pondQueryParams.params.userKeyword"
|
||||
placeholder="请输入用户名或手机号"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
@keyup.enter="handlePondQuery"
|
||||
/>
|
||||
@@ -538,10 +538,10 @@
|
||||
<el-button icon="Refresh" @click="resetPondQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
|
||||
<!-- 塘口表格 -->
|
||||
<el-table
|
||||
:data="pondList"
|
||||
<el-table
|
||||
:data="pondList"
|
||||
highlight-current-row
|
||||
height="400px"
|
||||
border
|
||||
@@ -554,9 +554,9 @@
|
||||
<el-table-column label="密度(尾/亩)" align="center" prop="density" />
|
||||
<el-table-column label="操作" align="center" width="100">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="handlePondSelect(scope.row)"
|
||||
>
|
||||
选择
|
||||
@@ -564,35 +564,35 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
v-show="pondTotal > 0"
|
||||
:total="pondTotal"
|
||||
v-model:page="pondQueryParams.pageNum"
|
||||
v-model:limit="pondQueryParams.pageSize"
|
||||
<pagination
|
||||
v-show="pondTotal > 0"
|
||||
:total="pondTotal"
|
||||
v-model:page="pondQueryParams.pageNum"
|
||||
v-model:limit="pondQueryParams.pageSize"
|
||||
@pagination="handlePondPaginationChange"
|
||||
class="mt-4"
|
||||
/>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="cancelPondSelect">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 开关信息对话框 -->
|
||||
<el-dialog
|
||||
:title="`开关信息 - ${currentDevice?.deviceName || ''} (${currentDevice?.serialNum || ''})`"
|
||||
v-model="switchDialogVisible"
|
||||
width="1400px"
|
||||
<el-dialog
|
||||
:title="`开关信息 - ${currentDevice?.deviceName || ''} (${currentDevice?.serialNum || ''})`"
|
||||
v-model="switchDialogVisible"
|
||||
width="1400px"
|
||||
append-to-body
|
||||
@close="closeSwitchDialog"
|
||||
>
|
||||
<el-table
|
||||
v-loading="switchLoading"
|
||||
:data="switchList"
|
||||
<el-table
|
||||
v-loading="switchLoading"
|
||||
:data="switchList"
|
||||
border
|
||||
height="400px"
|
||||
>
|
||||
@@ -617,7 +617,7 @@
|
||||
<template #default="scope">
|
||||
<dict-tag :options="open_close" :value="scope.row.electricWarnOpen"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
<el-table-column label="额定电流设置" align="center" prop="rateElectricValue" />
|
||||
<el-table-column label="联动状态" align="center" prop="isLinkedCtrl" >
|
||||
<template #default="scope">
|
||||
@@ -632,10 +632,10 @@
|
||||
<el-table-column label="操作" align="center" width="120" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="定时控制" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Timer"
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Timer"
|
||||
@click="handleViewSwitchTimingCtrl(scope.row)"
|
||||
v-hasPermi="['fishery:timingCtrl:list']"
|
||||
>
|
||||
@@ -644,25 +644,25 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closeSwitchDialog">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 联动控制对话框 -->
|
||||
<el-dialog
|
||||
:title="`联动控制 - ${currentDevice?.deviceName || ''} (${currentDevice?.serialNum || ''})`"
|
||||
v-model="linkedCtrlDialogVisible"
|
||||
width="1200px"
|
||||
<el-dialog
|
||||
:title="`联动控制 - ${currentDevice?.deviceName || ''} (${currentDevice?.serialNum || ''})`"
|
||||
v-model="linkedCtrlDialogVisible"
|
||||
width="1200px"
|
||||
append-to-body
|
||||
@close="closeLinkedCtrlDialog"
|
||||
>
|
||||
<el-table
|
||||
v-loading="linkedCtrlLoading"
|
||||
:data="linkedCtrlList"
|
||||
<el-table
|
||||
v-loading="linkedCtrlLoading"
|
||||
:data="linkedCtrlList"
|
||||
border
|
||||
height="400px"
|
||||
>
|
||||
@@ -686,35 +686,35 @@
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
v-show="linkedCtrlTotal > 0"
|
||||
:total="linkedCtrlTotal"
|
||||
v-model:page="linkedCtrlQueryParams.pageNum"
|
||||
v-model:limit="linkedCtrlQueryParams.pageSize"
|
||||
<pagination
|
||||
v-show="linkedCtrlTotal > 0"
|
||||
:total="linkedCtrlTotal"
|
||||
v-model:page="linkedCtrlQueryParams.pageNum"
|
||||
v-model:limit="linkedCtrlQueryParams.pageSize"
|
||||
@pagination="getLinkedCtrlList"
|
||||
class="mt-4"
|
||||
/>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closeLinkedCtrlDialog">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 校时记录对话框 -->
|
||||
<el-dialog
|
||||
:title="`校时记录 - ${currentDevice?.deviceName || ''} (${currentDevice?.serialNum || ''})`"
|
||||
v-model="correctRecordDialogVisible"
|
||||
width="1000px"
|
||||
<el-dialog
|
||||
:title="`校时记录 - ${currentDevice?.deviceName || ''} (${currentDevice?.serialNum || ''})`"
|
||||
v-model="correctRecordDialogVisible"
|
||||
width="1000px"
|
||||
append-to-body
|
||||
@close="closeCorrectRecordDialog"
|
||||
>
|
||||
<el-table
|
||||
v-loading="correctRecordLoading"
|
||||
:data="correctRecordList"
|
||||
<el-table
|
||||
v-loading="correctRecordLoading"
|
||||
:data="correctRecordList"
|
||||
border
|
||||
height="400px"
|
||||
>
|
||||
@@ -725,42 +725,42 @@
|
||||
<dict-tag :options="aqu_device_type" :value="scope.row.deviceType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="溶解氧" align="center" prop="valueDissolvedOxygen" />
|
||||
<el-table-column label="水温" align="center" prop="valueTemperature" />
|
||||
<el-table-column label="饱和度" align="center" prop="valueSaturability" />
|
||||
<el-table-column label="校准时间" align="center" prop="createTime" width="160"/>
|
||||
<!-- <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/> -->
|
||||
</el-table>
|
||||
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
v-show="correctRecordTotal > 0"
|
||||
:total="correctRecordTotal"
|
||||
v-model:page="correctRecordQueryParams.pageNum"
|
||||
v-model:limit="correctRecordQueryParams.pageSize"
|
||||
<pagination
|
||||
v-show="correctRecordTotal > 0"
|
||||
:total="correctRecordTotal"
|
||||
v-model:page="correctRecordQueryParams.pageNum"
|
||||
v-model:limit="correctRecordQueryParams.pageSize"
|
||||
@pagination="getCorrectRecordList"
|
||||
class="mt-4"
|
||||
/>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closeCorrectRecordDialog">关 闭</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 开关定时控制对话框 -->
|
||||
<el-dialog
|
||||
:title="`定时控制 - ${currentSwitch?.switchName || ''} (序号:${currentSwitch?.index || ''})`"
|
||||
v-model="switchTimingCtrlDialogVisible"
|
||||
width="800px"
|
||||
<el-dialog
|
||||
:title="`定时控制 - ${currentSwitch?.switchName || ''} (序号:${currentSwitch?.index || ''})`"
|
||||
v-model="switchTimingCtrlDialogVisible"
|
||||
width="800px"
|
||||
append-to-body
|
||||
@close="closeSwitchTimingCtrlDialog"
|
||||
>
|
||||
<el-table
|
||||
v-loading="switchTimingCtrlLoading"
|
||||
:data="switchTimingCtrlList"
|
||||
<el-table
|
||||
v-loading="switchTimingCtrlLoading"
|
||||
:data="switchTimingCtrlList"
|
||||
border
|
||||
height="400px"
|
||||
>
|
||||
@@ -777,7 +777,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="closeSwitchTimingCtrlDialog">关 闭</el-button>
|
||||
@@ -1138,7 +1138,7 @@ const handleUpdate = async (row?: DeviceVO) => {
|
||||
const _id = row?.id || ids.value[0]
|
||||
const res = await getDevice(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
|
||||
|
||||
// 回显用户信息
|
||||
if (form.value.userId) {
|
||||
try {
|
||||
@@ -1162,7 +1162,7 @@ const handleUpdate = async (row?: DeviceVO) => {
|
||||
} else {
|
||||
selectedUser.value = null;
|
||||
}
|
||||
|
||||
|
||||
// 回显塘口信息
|
||||
if (form.value.pondId) {
|
||||
try {
|
||||
@@ -1186,7 +1186,7 @@ const handleUpdate = async (row?: DeviceVO) => {
|
||||
} else {
|
||||
selectedPond.value = null;
|
||||
}
|
||||
|
||||
|
||||
dialog.visible = true;
|
||||
dialog.title = "修改设备管理";
|
||||
}
|
||||
@@ -1211,9 +1211,9 @@ const submitForm = () => {
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: DeviceVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除选中的数据项?').finally(() => loading.value = false);
|
||||
await proxy?.$modal.confirm('是否确认解绑选中的数据项?').finally(() => loading.value = false);
|
||||
await delDevice(_ids);
|
||||
proxy?.$modal.msgSuccess("删除成功");
|
||||
proxy?.$modal.msgSuccess("解绑成功");
|
||||
await getList();
|
||||
}
|
||||
|
||||
@@ -1284,14 +1284,14 @@ const openPondSelect = () => {
|
||||
// 重置搜索条件
|
||||
pondQueryParams.pageNum = 1;
|
||||
pondQueryParams.pondName = undefined;
|
||||
|
||||
|
||||
// 如果已选择用户,自动筛选该用户的塘口
|
||||
if (selectedUser.value) {
|
||||
pondQueryParams.params.userKeyword = selectedUser.value.userName || selectedUser.value.mobilePhone;
|
||||
} else {
|
||||
pondQueryParams.params.userKeyword = undefined;
|
||||
}
|
||||
|
||||
|
||||
getPondList();
|
||||
pondSelectVisible.value = true;
|
||||
};
|
||||
@@ -1332,10 +1332,10 @@ const handleViewSwitch = async (row: DeviceVO) => {
|
||||
currentDevice.value = row;
|
||||
switchLoading.value = true;
|
||||
try {
|
||||
const res = await listDeviceSwitch({
|
||||
const res = await listDeviceSwitch({
|
||||
pageNum: 1,
|
||||
pageSize: 100,
|
||||
deviceId: row.id
|
||||
deviceId: row.id
|
||||
});
|
||||
switchList.value = res.rows || res.data || [];
|
||||
switchDialogVisible.value = true;
|
||||
|
||||
Reference in New Issue
Block a user