|
@@ -1,81 +1,23 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="query-box">
|
|
|
|
|
- <div class="query-param">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="tableQueryTypeContent"
|
|
|
|
|
- style="width: 300px; height: 32px; margin-right: 40px; margin-bottom: 10px"
|
|
|
|
|
- :placeholder="tableQueryType ? '请输入' + tableQueryType : '请输入查找内容'"
|
|
|
|
|
- clearable
|
|
|
|
|
- :disabled="!tableQueryType"
|
|
|
|
|
- @input="handleTableQueryTypeContentChange"
|
|
|
|
|
- >
|
|
|
|
|
- <template #prepend>
|
|
|
|
|
- <el-select
|
|
|
|
|
- v-model="tableQueryType"
|
|
|
|
|
- placeholder="选择类型"
|
|
|
|
|
- style="width: 110px"
|
|
|
|
|
- @change="handleTableQueryTypeChange"
|
|
|
|
|
- clearable
|
|
|
|
|
- >
|
|
|
|
|
- <el-option v-for="item in tableQueryTypeOptions" :key="item.value" :label="item.name" :value="item.value" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-input>
|
|
|
|
|
- <div class="locations-query">
|
|
|
|
|
- <div>地点:</div>
|
|
|
|
|
- <el-cascader
|
|
|
|
|
- v-model="workLocation"
|
|
|
|
|
- :options="locationOptions"
|
|
|
|
|
- :props="locationProp"
|
|
|
|
|
- clearable
|
|
|
|
|
- collapse-tags
|
|
|
|
|
- :show-all-levels="false"
|
|
|
|
|
- placeholder="请选择地点"
|
|
|
|
|
- popper-class="special-cascader"
|
|
|
|
|
- @change="handleCascaderChange"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="algo-query">
|
|
|
|
|
- <div>算法:</div>
|
|
|
|
|
- <el-select v-model="tableQueryParams.queryParam.algoId" placeholder="请选择算法" clearable style="width: 200px">
|
|
|
|
|
- <el-option v-for="item in algoOptions" :key="item.value" :label="item.name" :value="item.value" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="query-btn">
|
|
|
|
|
- <el-button type="primary" @click="submitTableQuery">查询</el-button>
|
|
|
|
|
- <el-button @click="resetTable">重置</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="table-box">
|
|
|
|
|
- <el-table ref="multipleTableRef" :data="tableData" style="width: 100%" height="100%">
|
|
|
|
|
- <el-table-column type="selection" width="30" />
|
|
|
|
|
- <el-table-column label="相机名称" prop="cameraName" width="180" />
|
|
|
|
|
- <el-table-column label="设备ID" prop="cameraCode" width="180" />
|
|
|
|
|
- <el-table-column label="地点" prop="location" width="280">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- {{ row.workshopName + ' - ' + row.workspaceName }}
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="算法" prop="algoStatusList" min-width="200">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <div v-for="item in row.algoStatusList" :class="item.isDisabled ? 'close-algo' : ''">{{ item.algoName }}</div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="渲染" prop="isRenderDisabled" width="100">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <el-switch :model-value="!row.isRenderDisabled" @change="handleChangeRenderStatus(row)" @click.stop />
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="算法操作" fixed="right" width="300">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <el-button type="primary" text @click="handleSettingConfig(row)">配置</el-button>
|
|
|
|
|
- <el-button type="primary" text @click="batchOpenAlgos(row)">一键开启</el-button>
|
|
|
|
|
- <el-button type="primary" text @click="batchCloseAlgos(row)">一键关闭</el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
|
|
+ <QueryForm :algos-info="algosInfo" @on-search="handleQueryTableData" @on-reset="handleResetTableData" />
|
|
|
|
|
+ <div v-if="showActionBar" class="action-bar">
|
|
|
|
|
+ <span class="num-text">已选{{ chooseNum }}项</span>
|
|
|
|
|
+ <el-button :class="isAlgoAdd ? 'btn-active' : 'btn-normal'" @click="handleAlgosAdd">算法添加</el-button>
|
|
|
|
|
+ <el-button :class="isParamsSet ? 'btn-active' : 'btn-normal'" @click="handleParamsSet">参数设置</el-button>
|
|
|
|
|
+ <el-button :class="isAlgoOpen ? 'btn-active' : 'btn-normal'" @click="handleAlgosOpen">算法开启</el-button>
|
|
|
|
|
+ <el-button :class="isAlgoClose ? 'btn-active' : 'btn-normal'" @click="handleAlgosClose">算法关闭</el-button>
|
|
|
|
|
+ <el-button :class="isAlgoDelete ? 'btn-active' : 'btn-normal'" @click="handleAlgosDel">算法删除</el-button>
|
|
|
|
|
+ <span class="close-btn" @click="handleSelectNone"></span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <SingleCameraTable
|
|
|
|
|
+ ref="singleCameraTableRef"
|
|
|
|
|
+ class="table-bar"
|
|
|
|
|
+ :table-data="tableData"
|
|
|
|
|
+ @on-filter="handleFilterTable"
|
|
|
|
|
+ @on-reset="handleResetTable"
|
|
|
|
|
+ @on-refresh="getTableData"
|
|
|
|
|
+ @update:selection="handlePop"
|
|
|
|
|
+ />
|
|
|
<Pagination
|
|
<Pagination
|
|
|
v-model:page="tableQueryParams.pageNumber"
|
|
v-model:page="tableQueryParams.pageNumber"
|
|
|
v-model:size="tableQueryParams.pageSize"
|
|
v-model:size="tableQueryParams.pageSize"
|
|
@@ -84,35 +26,48 @@
|
|
|
@update:size="handleSizeChange"
|
|
@update:size="handleSizeChange"
|
|
|
style="margin-bottom: 0"
|
|
style="margin-bottom: 0"
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <BatchOperationDialog
|
|
|
|
|
+ v-if="batchOperationVisible"
|
|
|
|
|
+ :type="batchOperationType"
|
|
|
|
|
+ :camera-ids="chooseId"
|
|
|
|
|
+ :all-algo-list="algosInfo"
|
|
|
|
|
+ @on-confirm="handleConfirmBatchOperation"
|
|
|
|
|
+ @on-close="handleCloseBatchOperation"
|
|
|
|
|
+ />
|
|
|
|
|
+ <div class="batch-param-set" v-if="isBatchParamSetVisible">
|
|
|
|
|
+ <div class="batch-param-set-header">
|
|
|
|
|
+ <div class="algo-title">气密人员隔离</div>
|
|
|
|
|
+ <div class="set-tips">
|
|
|
|
|
+ <el-icon :size="15"><InfoFilled /></el-icon>
|
|
|
|
|
+ <div class="tip"
|
|
|
|
|
+ >当前为默认参数值,请选择具体参数进行修改,提交后,新参数值将对所选相机全部生效,覆盖原有参数值</div
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-icon class="set-close" :size="24" @click="isBatchParamSetVisible = false"><Close /></el-icon>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <AlgoParamsSetting :algo-detail="selectedAlgoDetail" @on-submit="handleSubmit" @on-cancel="handleCancel" />
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { onMounted, ref } from 'vue';
|
|
import { onMounted, ref } from 'vue';
|
|
|
- import {
|
|
|
|
|
- ElSelect,
|
|
|
|
|
- ElOption,
|
|
|
|
|
- ElInput,
|
|
|
|
|
- ElCascader,
|
|
|
|
|
- ElButton,
|
|
|
|
|
- ElTable,
|
|
|
|
|
- ElTableColumn,
|
|
|
|
|
- ElSwitch,
|
|
|
|
|
- ElMessageBox,
|
|
|
|
|
- } from 'element-plus';
|
|
|
|
|
- import { useWorkLocation } from '@/views/datamanager/alertformdata/hooks/useWorkLocation';
|
|
|
|
|
|
|
+ import { ElButton, ElIcon } from 'element-plus';
|
|
|
|
|
+ import { InfoFilled, Close } from '@element-plus/icons-vue';
|
|
|
import {
|
|
import {
|
|
|
QueryCameraPageByAlgoParams,
|
|
QueryCameraPageByAlgoParams,
|
|
|
QueryCameraPageByAlgoRes,
|
|
QueryCameraPageByAlgoRes,
|
|
|
getCameraListByAlgo,
|
|
getCameraListByAlgo,
|
|
|
- updateAlgosStatusByCameraId,
|
|
|
|
|
- updateAlgosStatusByBatch,
|
|
|
|
|
|
|
+ QueryAlgoInfoRes,
|
|
|
getAlgosInfo,
|
|
getAlgosInfo,
|
|
|
|
|
+ addAlgosByBatch,
|
|
|
|
|
+ deleteAlgosByBatch,
|
|
|
|
|
+ updateAlgosStatusByBatch,
|
|
|
} from '@/api/camera/camera-config';
|
|
} from '@/api/camera/camera-config';
|
|
|
- import { renderCamera } from '@/api/camera/camera-preview';
|
|
|
|
|
|
|
+ import QueryForm from './QueryForm.vue';
|
|
|
|
|
+ import SingleCameraTable from './SingleCameraTable.vue';
|
|
|
import Pagination from '@/components/Pagination/Pagination.vue';
|
|
import Pagination from '@/components/Pagination/Pagination.vue';
|
|
|
- import { mockQueryCameraPageByAlgoRes } from './mockData';
|
|
|
|
|
-
|
|
|
|
|
- const { locationOptions, getLocationOptions } = useWorkLocation();
|
|
|
|
|
|
|
+ import BatchOperationDialog from './BatchOperationDialog.vue';
|
|
|
|
|
+ import AlgoParamsSetting from '@/modules/algo/algo-params-edit/index.vue'; // 多相机共同算法配置组件
|
|
|
|
|
|
|
|
const tableQueryParams = ref<QueryCameraPageByAlgoParams>({
|
|
const tableQueryParams = ref<QueryCameraPageByAlgoParams>({
|
|
|
pageNumber: 1,
|
|
pageNumber: 1,
|
|
@@ -120,62 +75,171 @@
|
|
|
queryParam: {},
|
|
queryParam: {},
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ const algosInfo = ref<QueryAlgoInfoRes[]>([]);
|
|
|
|
|
+ const singleCameraTableRef = ref<typeof SingleCameraTable>();
|
|
|
const tableData = ref<QueryCameraPageByAlgoRes[]>([]);
|
|
const tableData = ref<QueryCameraPageByAlgoRes[]>([]);
|
|
|
- // const tableData = ref(mockQueryCameraPageByAlgoRes); // Mock data for testing
|
|
|
|
|
|
|
+ const total = ref(0);
|
|
|
|
|
+ // 多选相机 批量操作
|
|
|
|
|
+ const showActionBar = ref(false);
|
|
|
|
|
+ const chooseNum = ref(0);
|
|
|
|
|
+ const chooseRow = ref<QueryCameraPageByAlgoRes[]>([]); // 被选中的数据行
|
|
|
|
|
+ const chooseId = ref<number[]>([]);
|
|
|
|
|
+ // 按钮点击激活状态
|
|
|
|
|
+ const isAlgoAdd = ref(false);
|
|
|
|
|
+ const isParamsSet = ref(false);
|
|
|
|
|
+ const isAlgoClose = ref(false);
|
|
|
|
|
+ const isAlgoOpen = ref(false);
|
|
|
|
|
+ const isAlgoDelete = ref(false);
|
|
|
|
|
+ const batchOperationType = ref('');
|
|
|
|
|
+ const batchOperationVisible = ref(false);
|
|
|
|
|
+ // 批量参数设置
|
|
|
|
|
+ const isBatchParamSetVisible = ref(true);
|
|
|
|
|
|
|
|
- const tableQueryTypeOptions = [
|
|
|
|
|
- { name: '相机名称', value: '相机名称' },
|
|
|
|
|
- { name: '相机ID', value: '相机ID' },
|
|
|
|
|
- ];
|
|
|
|
|
- const algoOptions = ref<{ name: string; value: number }[]>([]); // 算法选择器选项
|
|
|
|
|
- const tableQueryType = ref<string>('');
|
|
|
|
|
- const tableQueryTypeContent = ref<string>('');
|
|
|
|
|
- const workLocation = ref([]); // 级联选择器,为二维数组(提取workspaceId)
|
|
|
|
|
- const locationProp = { multiple: true, expandTrigger: 'hover' as const }; // 级联选择器(打开多选)
|
|
|
|
|
- // 分页
|
|
|
|
|
- const total = ref(0); // 总条数
|
|
|
|
|
|
|
+ // 查询
|
|
|
|
|
+ const handleQueryTableData = (queryParams) => {
|
|
|
|
|
+ tableQueryParams.value.queryParam.cameraName = queryParams.queryParam.cameraName;
|
|
|
|
|
+ tableQueryParams.value.queryParam.cameraCode = queryParams.queryParam.cameraCode;
|
|
|
|
|
+ tableQueryParams.value.queryParam.workspaceIdList = queryParams.queryParam.workspaceIdList;
|
|
|
|
|
+ tableQueryParams.value.queryParam.algoId = queryParams.queryParam.algoId;
|
|
|
|
|
+ tableQueryParams.value.pageNumber = 1;
|
|
|
|
|
+ tableQueryParams.value.pageSize = 10;
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ };
|
|
|
|
|
+ // 重置 (清空查询条件, 不清空筛选条件)
|
|
|
|
|
+ const handleResetTableData = () => {
|
|
|
|
|
+ Reflect.deleteProperty(tableQueryParams.value.queryParam, 'cameraName');
|
|
|
|
|
+ Reflect.deleteProperty(tableQueryParams.value.queryParam, 'cameraCode');
|
|
|
|
|
+ Reflect.deleteProperty(tableQueryParams.value.queryParam, 'workspaceIdList');
|
|
|
|
|
+ Reflect.deleteProperty(tableQueryParams.value.queryParam, 'algoId');
|
|
|
|
|
+ tableQueryParams.value.pageNumber = 1;
|
|
|
|
|
+ tableQueryParams.value.pageSize = 10;
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- const handleTableQueryTypeChange = () => {
|
|
|
|
|
- if (tableQueryType.value === '相机名称') {
|
|
|
|
|
- delete tableQueryParams.value.queryParam.cameraCode;
|
|
|
|
|
- } else if (tableQueryType.value === '相机ID') {
|
|
|
|
|
- delete tableQueryParams.value.queryParam.cameraName;
|
|
|
|
|
- } else {
|
|
|
|
|
- delete tableQueryParams.value.queryParam.cameraCode;
|
|
|
|
|
- delete tableQueryParams.value.queryParam.cameraName;
|
|
|
|
|
|
|
+ // 筛选
|
|
|
|
|
+ const handleFilterTable = (type: string, opened: boolean, closed: boolean) => {
|
|
|
|
|
+ // 为了在筛选时 保留 查询条件,将筛选处理放在此处
|
|
|
|
|
+ if (type === 'algo') {
|
|
|
|
|
+ if (opened && !closed) {
|
|
|
|
|
+ tableQueryParams.value.queryParam.isAlgoDisabled = false;
|
|
|
|
|
+ } else if (!opened && closed) {
|
|
|
|
|
+ tableQueryParams.value.queryParam.isAlgoDisabled = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Reflect.deleteProperty(tableQueryParams.value.queryParam, 'isAlgoDisabled');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- tableQueryTypeContent.value = '';
|
|
|
|
|
- };
|
|
|
|
|
- const handleTableQueryTypeContentChange = () => {
|
|
|
|
|
- if (tableQueryType.value === '相机名称') {
|
|
|
|
|
- tableQueryParams.value.queryParam.cameraName = tableQueryTypeContent.value;
|
|
|
|
|
- } else if (tableQueryType.value === '相机ID') {
|
|
|
|
|
- tableQueryParams.value.queryParam.cameraCode = tableQueryTypeContent.value;
|
|
|
|
|
|
|
+ if (type === 'render') {
|
|
|
|
|
+ if (opened && !closed) {
|
|
|
|
|
+ tableQueryParams.value.queryParam.isRenderDisabled = false;
|
|
|
|
|
+ } else if (!opened && closed) {
|
|
|
|
|
+ tableQueryParams.value.queryParam.isRenderDisabled = true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Reflect.deleteProperty(tableQueryParams.value.queryParam, 'isRenderDisabled');
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+ tableQueryParams.value.pageNumber = 1;
|
|
|
|
|
+ tableQueryParams.value.pageSize = 10;
|
|
|
|
|
+ getTableData();
|
|
|
};
|
|
};
|
|
|
- const handleCascaderChange = () => {
|
|
|
|
|
- if (workLocation.value.length !== 0) {
|
|
|
|
|
- const arr = [];
|
|
|
|
|
- workLocation.value.forEach((item) => {
|
|
|
|
|
- arr.push(item[1]);
|
|
|
|
|
- });
|
|
|
|
|
- tableQueryParams.value.queryParam.workspaceIdList = arr;
|
|
|
|
|
- } else {
|
|
|
|
|
- Reflect.deleteProperty(tableQueryParams.value.queryParam, 'workspaceIdList');
|
|
|
|
|
|
|
+ // 清空筛选 (不清空查询条件)
|
|
|
|
|
+ const handleResetTable = (type: string) => {
|
|
|
|
|
+ if (type === 'algo') {
|
|
|
|
|
+ Reflect.deleteProperty(tableQueryParams.value.queryParam, 'isAlgoDisabled');
|
|
|
}
|
|
}
|
|
|
|
|
+ if (type === 'render') {
|
|
|
|
|
+ Reflect.deleteProperty(tableQueryParams.value.queryParam, 'isRenderDisabled');
|
|
|
|
|
+ }
|
|
|
|
|
+ tableQueryParams.value.pageNumber = 1;
|
|
|
|
|
+ tableQueryParams.value.pageSize = 10;
|
|
|
|
|
+ getTableData();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const submitTableQuery = () => {
|
|
|
|
|
- getTableData();
|
|
|
|
|
|
|
+ // 多选
|
|
|
|
|
+ const handlePop = (selection) => {
|
|
|
|
|
+ chooseRow.value = selection;
|
|
|
|
|
+ chooseId.value = [];
|
|
|
|
|
+ selection.forEach((item) => {
|
|
|
|
|
+ if (chooseId.value.indexOf(item.cameraId) === -1) chooseId.value.push(item.cameraId);
|
|
|
|
|
+ });
|
|
|
|
|
+ chooseNum.value = selection.length;
|
|
|
|
|
+ showActionBar.value = chooseNum.value > 0 ? true : false;
|
|
|
|
|
+ };
|
|
|
|
|
+ // 取消多选
|
|
|
|
|
+ const handleSelectNone = () => {
|
|
|
|
|
+ chooseId.value = [];
|
|
|
|
|
+ chooseNum.value = 0;
|
|
|
|
|
+ singleCameraTableRef.value?.clearAll();
|
|
|
|
|
+ showActionBar.value = false;
|
|
|
|
|
+ handleResetBtnStatus();
|
|
|
};
|
|
};
|
|
|
|
|
+ // 重置按钮点击状态
|
|
|
|
|
+ function handleResetBtnStatus() {
|
|
|
|
|
+ isAlgoAdd.value = false;
|
|
|
|
|
+ isParamsSet.value = false;
|
|
|
|
|
+ isAlgoClose.value = false;
|
|
|
|
|
+ isAlgoOpen.value = false;
|
|
|
|
|
+ isAlgoDelete.value = false;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- const resetTable = () => {
|
|
|
|
|
- tableQueryType.value = '';
|
|
|
|
|
- tableQueryTypeContent.value = '';
|
|
|
|
|
- workLocation.value = [];
|
|
|
|
|
- tableQueryParams.value.pageNumber = 1;
|
|
|
|
|
- tableQueryParams.value.pageSize = 10;
|
|
|
|
|
- tableQueryParams.value.queryParam = {};
|
|
|
|
|
|
|
+ // 批量操作
|
|
|
|
|
+ const handleAlgosAdd = () => {
|
|
|
|
|
+ isAlgoAdd.value = true;
|
|
|
|
|
+ batchOperationType.value = 'add';
|
|
|
|
|
+ batchOperationVisible.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleParamsSet = () => {
|
|
|
|
|
+ isParamsSet.value = true;
|
|
|
|
|
+ batchOperationType.value = 'set';
|
|
|
|
|
+ batchOperationVisible.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleAlgosOpen = () => {
|
|
|
|
|
+ isAlgoOpen.value = true;
|
|
|
|
|
+ batchOperationType.value = 'open';
|
|
|
|
|
+ batchOperationVisible.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleAlgosClose = () => {
|
|
|
|
|
+ isAlgoClose.value = true;
|
|
|
|
|
+ batchOperationType.value = 'close';
|
|
|
|
|
+ batchOperationVisible.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleAlgosDel = () => {
|
|
|
|
|
+ isAlgoDelete.value = true;
|
|
|
|
|
+ batchOperationType.value = 'delete';
|
|
|
|
|
+ batchOperationVisible.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+ // 批量操作弹窗
|
|
|
|
|
+ const handleConfirmBatchOperation = (algoIds) => {
|
|
|
|
|
+ console.log('algoIds', algoIds);
|
|
|
|
|
+ console.log('batchOperationType.value', batchOperationType.value);
|
|
|
|
|
+ // 这里可以根据不同的操作类型,调用不同的接口
|
|
|
|
|
+ if (batchOperationType.value === 'add') {
|
|
|
|
|
+ addAlgosByBatch({ cameraIdList: chooseId.value, algoIdList: algoIds }).then(() => {
|
|
|
|
|
+ handleCloseBatchOperation();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (batchOperationType.value === 'set') {
|
|
|
|
|
+ isBatchParamSetVisible.value = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (batchOperationType.value === 'open') {
|
|
|
|
|
+ updateAlgosStatusByBatch({ cameraIdList: chooseId.value, algoIdList: algoIds, isEnabled: true }).then(() => {
|
|
|
|
|
+ handleCloseBatchOperation();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (batchOperationType.value === 'close') {
|
|
|
|
|
+ updateAlgosStatusByBatch({ cameraIdList: chooseId.value, algoIdList: algoIds, isEnabled: false }).then(() => {
|
|
|
|
|
+ handleCloseBatchOperation();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ if (batchOperationType.value === 'delete') {
|
|
|
|
|
+ deleteAlgosByBatch({ cameraIdList: chooseId.value, algoIdList: algoIds }).then(() => {
|
|
|
|
|
+ handleCloseBatchOperation();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleCloseBatchOperation = () => {
|
|
|
|
|
+ batchOperationType.value = '';
|
|
|
|
|
+ batchOperationVisible.value = false;
|
|
|
|
|
+ handleResetBtnStatus();
|
|
|
getTableData();
|
|
getTableData();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -189,103 +253,111 @@
|
|
|
getTableData();
|
|
getTableData();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- // 切换渲染状态
|
|
|
|
|
- const handleChangeRenderStatus = (row) => {
|
|
|
|
|
- const tempRenderStatus = row.isRenderDisabled ? 'demo' : 'null';
|
|
|
|
|
- console.log('切换渲染状态', tempRenderStatus);
|
|
|
|
|
- renderCamera({
|
|
|
|
|
- render: tempRenderStatus,
|
|
|
|
|
- cameraId: row.cameraId,
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- console.log('渲染开启成功');
|
|
|
|
|
- getTableData();
|
|
|
|
|
- })
|
|
|
|
|
- .catch(() => {
|
|
|
|
|
- console.log('渲染开启失败');
|
|
|
|
|
- ElMessageBox.alert('开启数量达到上限,请关闭其他相机渲染后再开启。', '渲染开启失败', {
|
|
|
|
|
- type: 'warning',
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
- // 配置算法(单相机配置)
|
|
|
|
|
- const handleSettingConfig = (row) => {
|
|
|
|
|
- console.log('配置算法,进入算法设置详情页', row);
|
|
|
|
|
- // TODO: 跳转到算法设置详情页
|
|
|
|
|
- };
|
|
|
|
|
- // 一键开启算法(单相机一键开启)
|
|
|
|
|
- const batchOpenAlgos = (row) => {
|
|
|
|
|
- console.log('开启算法', row);
|
|
|
|
|
- updateAlgosStatusByCameraId({ cameraId: row.cameraId, isDisabled: false }).then(() => {
|
|
|
|
|
- console.log('开启算法成功');
|
|
|
|
|
- getTableData();
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
- // 一键关闭算法(单相机一键关闭)
|
|
|
|
|
- const batchCloseAlgos = (row) => {
|
|
|
|
|
- console.log('关闭算法', row);
|
|
|
|
|
- updateAlgosStatusByCameraId({ cameraId: row.cameraId, isDisabled: true }).then(() => {
|
|
|
|
|
- console.log('关闭算法成功');
|
|
|
|
|
- getTableData();
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
const getTableData = async () => {
|
|
const getTableData = async () => {
|
|
|
- console.log('Query params:', tableQueryParams.value);
|
|
|
|
|
await getCameraListByAlgo(tableQueryParams.value).then((res) => {
|
|
await getCameraListByAlgo(tableQueryParams.value).then((res) => {
|
|
|
- console.log('Camera data:', res);
|
|
|
|
|
tableData.value = res.records;
|
|
tableData.value = res.records;
|
|
|
total.value = res.totalRow;
|
|
total.value = res.totalRow;
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const getAllAlgosInfo = async () => {
|
|
|
|
|
- await getAlgosInfo().then((res) => {
|
|
|
|
|
- algoOptions.value = res.map((item) => ({ name: item.name, value: item.id }));
|
|
|
|
|
- });
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
getTableData();
|
|
getTableData();
|
|
|
- getLocationOptions();
|
|
|
|
|
- getAllAlgosInfo();
|
|
|
|
|
|
|
+ getAlgosInfo().then((res) => {
|
|
|
|
|
+ algosInfo.value = res;
|
|
|
|
|
+ console.log('algosInfo', algosInfo.value);
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
- .query-box {
|
|
|
|
|
- margin-bottom: 10px;
|
|
|
|
|
|
|
+ .action-bar {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ min-width: calc(100vw - 266px);
|
|
|
|
|
+ height: 50px;
|
|
|
|
|
+ border-radius: 4px 4px 0px 0px;
|
|
|
|
|
+ background-color: #ddefff;
|
|
|
|
|
+ z-index: 10;
|
|
|
|
|
+
|
|
|
|
|
+ .num-text {
|
|
|
|
|
+ margin: 0 34px 0 25px;
|
|
|
|
|
+ color: rgba(0, 0, 0, 0.85);
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- .query-param {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-wrap: wrap;
|
|
|
|
|
- flex-direction: row;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- flex: 1;
|
|
|
|
|
|
|
+ .btn-normal {
|
|
|
|
|
+ color: #1890ff;
|
|
|
|
|
+ background: transparent;
|
|
|
|
|
+ border: 1px solid #1890ff;
|
|
|
|
|
+ border-radius: 2px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .locations-query,
|
|
|
|
|
- .algo-query {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- margin-right: 40px;
|
|
|
|
|
- margin-bottom: 10px;
|
|
|
|
|
|
|
+ .btn-active,
|
|
|
|
|
+ .btn-normal:hover {
|
|
|
|
|
+ color: #ffffff;
|
|
|
|
|
+ background-color: #1890ff;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .query-btn {
|
|
|
|
|
|
|
+ .close-btn {
|
|
|
margin-left: auto;
|
|
margin-left: auto;
|
|
|
- margin-bottom: 10px;
|
|
|
|
|
|
|
+ margin-right: 20px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .close-btn:before {
|
|
|
|
|
+ content: '\2716';
|
|
|
|
|
+ color: #000;
|
|
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .table-box {
|
|
|
|
|
- height: calc(100vh - 280px);
|
|
|
|
|
|
|
+ .table-bar {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .batch-param-set {
|
|
|
|
|
+ width: 1030px;
|
|
|
|
|
+ height: 550px;
|
|
|
|
|
+ padding: 20px;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1);
|
|
|
|
|
+ background-color: #ffffff;
|
|
|
|
|
+ z-index: 20;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 50%;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
|
+
|
|
|
|
|
+ .batch-param-set-header {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 80px;
|
|
|
|
|
+ border-bottom: 1px solid #e4e7ec;
|
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+
|
|
|
|
|
+ .algo-title {
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #000000;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .set-tips {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ color: #66abeb;
|
|
|
|
|
+
|
|
|
|
|
+ .tip {
|
|
|
|
|
+ margin-left: 2px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- .close-algo {
|
|
|
|
|
- color: #cccccc;
|
|
|
|
|
- text-decoration: line-through;
|
|
|
|
|
|
|
+ .set-close {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|