|
@@ -1,18 +1,15 @@
|
|
|
<template>
|
|
<template>
|
|
|
<el-container class="is-vertical">
|
|
<el-container class="is-vertical">
|
|
|
- <sc-page-header @filter="toggleFormEnabled" @add="table_add"></sc-page-header>
|
|
|
|
|
|
|
+ <sc-page-header @add="table_add"></sc-page-header>
|
|
|
|
|
|
|
|
- <scTable ref="xGridTable" :apiObj="$API.carwash.device" framework="zeroLite" :formConfig="formConfig" :paramsColums="paramsColums" :toolbarConfig="toolbarConfig" :columns="columns">
|
|
|
|
|
|
|
+ <scTable ref="xGridTable" :apiObj="$API.carwash.boxDev" framework="zeroLite" :toolbarConfig="toolbarConfig" :columns="columns" :pagerConfig="pagerConfig">
|
|
|
<template #action="{ row }">
|
|
<template #action="{ row }">
|
|
|
- <template v-if="row.nodeType == 'master'">
|
|
|
|
|
- <el-button type="primary" link @click="table_camera(row)">
|
|
|
|
|
- <template #icon><sc-iconify icon="material-symbols:speed-camera-outline"></sc-iconify></template>摄像头
|
|
|
|
|
- </el-button>
|
|
|
|
|
- <el-button type="primary" link @click="table_snap(row)">
|
|
|
|
|
- <template #icon><sc-iconify icon="mingcute:pic-line"></sc-iconify></template>设备抓拍
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <el-button type="primary" link @click="table_camera(row)">
|
|
|
|
|
+ <template #icon><sc-iconify icon="material-symbols:speed-camera-outline"></sc-iconify></template>摄像头
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button type="primary" link @click="table_snap(row)">
|
|
|
|
|
+ <template #icon><sc-iconify icon="mingcute:pic-line"></sc-iconify></template>设备抓拍
|
|
|
|
|
+ </el-button>
|
|
|
<el-button type="primary" link @click="table_edit(row)">
|
|
<el-button type="primary" link @click="table_edit(row)">
|
|
|
<template #icon><sc-iconify icon="ant-design:edit-outlined"></sc-iconify></template>修改
|
|
<template #icon><sc-iconify icon="ant-design:edit-outlined"></sc-iconify></template>修改
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -32,8 +29,8 @@
|
|
|
import XEUtils from "xe-utils";
|
|
import XEUtils from "xe-utils";
|
|
|
import API from "@/api";
|
|
import API from "@/api";
|
|
|
import TOOL from "@/utils/tool";
|
|
import TOOL from "@/utils/tool";
|
|
|
-import { mapFormItemInput } from "@/components/scTable/helper";
|
|
|
|
|
import { nodeTypeDic } from "@/utils/basicDic";
|
|
import { nodeTypeDic } from "@/utils/basicDic";
|
|
|
|
|
+
|
|
|
import deviceDetail from "./detail";
|
|
import deviceDetail from "./detail";
|
|
|
import cameraDetail from "./camera";
|
|
import cameraDetail from "./camera";
|
|
|
import snapDetail from "./snap";
|
|
import snapDetail from "./snap";
|
|
@@ -43,26 +40,18 @@ const toolbarConfig = reactive({
|
|
|
print: false
|
|
print: false
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const formConfig = reactive({
|
|
|
|
|
- data: {
|
|
|
|
|
- nodeType: XEUtils.keys(nodeTypeDic)
|
|
|
|
|
- },
|
|
|
|
|
- items: [
|
|
|
|
|
- mapFormItemInput("deviceCode", "设备编号")
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+const pagerConfig = reactive({
|
|
|
|
|
+ queryType: "expands"
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const paramsColums = reactive([
|
|
|
|
|
- { type: "relation", column: "nodeType", symbol: "or" },
|
|
|
|
|
- { type: "relation", column: "deviceCode", symbol: "like" },
|
|
|
|
|
- { type: "orderby", column: "createTime", symbol: "desc" }
|
|
|
|
|
-])
|
|
|
|
|
-
|
|
|
|
|
const columns = reactive([
|
|
const columns = reactive([
|
|
|
{ type: "seq", width: 60 },
|
|
{ type: "seq", width: 60 },
|
|
|
{ type: "html", field: "deviceCode", title: "设备编号", minWidth: 160, sortable: true },
|
|
{ type: "html", field: "deviceCode", title: "设备编号", minWidth: 160, sortable: true },
|
|
|
|
|
+ { type: "html", field: "features.name", title: "设备名称", minWidth: 160, sortable: true },
|
|
|
{ type: "html", field: "deviceType", title: "设备类型", minWidth: 160, sortable: true },
|
|
{ type: "html", field: "deviceType", title: "设备类型", minWidth: 160, sortable: true },
|
|
|
- { type: "html", field: "nodeType", title: "节点类型", minWidth: 100, sortable: true, formatter: ({ cellValue }) => XEUtils.get(nodeTypeDic, cellValue, cellValue) },
|
|
|
|
|
|
|
+ { type: "html", field: "features.minStagnantTime", title: "冲洗时长", minWidth: 100, sortable: true },
|
|
|
|
|
+ { type: "html", field: "features.minPictureSaveTime", title: "图片采集间隔", minWidth: 120, sortable: true },
|
|
|
|
|
+ { type: "html", field: "features.maxWaitingTime", title: "超时等待时间", minWidth: 120, sortable: true },
|
|
|
{ type: "html", field: "CreateTime", title: "创建时间", minWidth: 160, sortable: true, formatter: ({ cellValue, row }) => cellValue || TOOL.dateFormat(row.createTime) },
|
|
{ type: "html", field: "CreateTime", title: "创建时间", minWidth: 160, sortable: true, formatter: ({ cellValue, row }) => cellValue || TOOL.dateFormat(row.createTime) },
|
|
|
{ type: "html", field: "UpdateTime", title: "更新时间", minWidth: 160, sortable: true, formatter: ({ cellValue, row }) => cellValue || TOOL.dateFormat(row.updateTime) },
|
|
{ type: "html", field: "UpdateTime", title: "更新时间", minWidth: 160, sortable: true, formatter: ({ cellValue, row }) => cellValue || TOOL.dateFormat(row.updateTime) },
|
|
|
{ title: "操作", fixed: "right", width: 300, align: "center", slots: { default: "action" } }
|
|
{ title: "操作", fixed: "right", width: 300, align: "center", slots: { default: "action" } }
|
|
@@ -70,7 +59,6 @@ const columns = reactive([
|
|
|
|
|
|
|
|
// 显示隐藏 筛选表单
|
|
// 显示隐藏 筛选表单
|
|
|
const xGridTable = ref();
|
|
const xGridTable = ref();
|
|
|
-const toggleFormEnabled = () => xGridTable.value.toggleFormEnabled();
|
|
|
|
|
const refreshTable = (mode = "add") => {
|
|
const refreshTable = (mode = "add") => {
|
|
|
xGridTable.value.reloadColumn(columns);
|
|
xGridTable.value.reloadColumn(columns);
|
|
|
xGridTable.value.searchData(mode);
|
|
xGridTable.value.searchData(mode);
|
|
@@ -111,10 +99,16 @@ const table_del = ({ id }) => {
|
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消"
|
|
cancelButtonText: "取消"
|
|
|
}).then(() => {
|
|
}).then(() => {
|
|
|
- API.carwash.device.del([{ id }]).then(res => {
|
|
|
|
|
|
|
+ API.carwash.boxDev.child({ expands: { masterId: id } }).then(res => {
|
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
|
- ElMessage.success("操作成功");
|
|
|
|
|
- refreshTable();
|
|
|
|
|
|
|
+ if (!(res.datas || []).length) {
|
|
|
|
|
+ API.carwash.boxDev.del([{ id }]).then(res => {
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ ElMessage.success("操作成功");
|
|
|
|
|
+ refreshTable();
|
|
|
|
|
+ } else throw res.message;
|
|
|
|
|
+ }).catch(error => ElMessage.error(error));
|
|
|
|
|
+ } else ElMessage.warning("当前设备存在摄像头,请移除后再试");
|
|
|
} else throw res.message;
|
|
} else throw res.message;
|
|
|
}).catch(error => ElMessage.error(error));
|
|
}).catch(error => ElMessage.error(error));
|
|
|
});
|
|
});
|