|
@@ -13,12 +13,14 @@
|
|
|
:icon="Plus"
|
|
:icon="Plus"
|
|
|
@click="handleAddSecurityPosition"
|
|
@click="handleAddSecurityPosition"
|
|
|
>
|
|
>
|
|
|
- 新建治安重点部位
|
|
|
|
|
|
|
+ 新建重点监控部位
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<BasicSearch
|
|
<BasicSearch
|
|
|
:searchConfig="SECURITY_POSITION_LIST_SEARCH_CONFIG"
|
|
:searchConfig="SECURITY_POSITION_LIST_SEARCH_CONFIG"
|
|
|
:searchData="searchData"
|
|
:searchData="searchData"
|
|
|
|
|
+ :custom-reset="true"
|
|
|
@update:search-data="handleSearch"
|
|
@update:search-data="handleSearch"
|
|
|
|
|
+ @custom-reset="handleReset"
|
|
|
>
|
|
>
|
|
|
<template #securityPosition>
|
|
<template #securityPosition>
|
|
|
<el-input
|
|
<el-input
|
|
@@ -55,26 +57,33 @@
|
|
|
<template #cameraName="scope">
|
|
<template #cameraName="scope">
|
|
|
<div class="camera-name-container">
|
|
<div class="camera-name-container">
|
|
|
<div v-for="item in scope.row.children" :key="item.id">
|
|
<div v-for="item in scope.row.children" :key="item.id">
|
|
|
- {{ item.name }}
|
|
|
|
|
|
|
+ <ThumbnailClick
|
|
|
|
|
+ :imageUrl="item.pushStreamDTO.imageUrl"
|
|
|
|
|
+ :code="item.code"
|
|
|
|
|
+ position="right"
|
|
|
|
|
+ @mouse-enter="handleMouseEnter"
|
|
|
|
|
+ @mouse-leave="handleMouseLeave"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div
|
|
|
|
|
+ :class="{ active: activeCameraCode === item.code && activePositionId === scope.row.id }"
|
|
|
|
|
+ @click="handleCameraClick(scope.row.id, item.code)"
|
|
|
|
|
+ >{{ item.name }}</div
|
|
|
|
|
+ >
|
|
|
|
|
+ </ThumbnailClick>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <template #action="scope">
|
|
|
|
|
|
|
+ <template #action="{ row, index }">
|
|
|
<div class="action-container--div">
|
|
<div class="action-container--div">
|
|
|
- <ActionButton text="上移" @click="handleUpOne(scope.row.id, scope.row.orderNum)" />
|
|
|
|
|
- <ActionButton text="下移" @click="handleDownOne(scope.row.id, scope.row.orderNum)" />
|
|
|
|
|
- <ActionButton
|
|
|
|
|
- text="编辑"
|
|
|
|
|
- v-if="securityPositionManagePermission"
|
|
|
|
|
- @click="handleEditSecurityPosition(scope.row)"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <ActionButton text="上移" @click="handleUpOne(row, index)" v-if="index > 0" />
|
|
|
|
|
+ <ActionButton text="下移" @click="handleDownOne(row, index)" v-if="index < tableData.length - 1" />
|
|
|
|
|
+ <ActionButton text="编辑" @click="handleEditSecurityPosition(row)" />
|
|
|
<ActionButton
|
|
<ActionButton
|
|
|
- v-if="securityPositionManagePermission"
|
|
|
|
|
text="删除"
|
|
text="删除"
|
|
|
:popconfirm="{
|
|
:popconfirm="{
|
|
|
title: '是否删除该治安重点部位?',
|
|
title: '是否删除该治安重点部位?',
|
|
|
}"
|
|
}"
|
|
|
- @confirm="handleDeleteSecurityPosition(scope.row.id)"
|
|
|
|
|
|
|
+ @confirm="handleDeleteSecurityPosition(row.id)"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -98,6 +107,7 @@
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
|
import UpdatePositionMonitorCamera from '@/components/position-monitor-camera-edit/UpdatePositionMonitorCamera.vue';
|
|
import UpdatePositionMonitorCamera from '@/components/position-monitor-camera-edit/UpdatePositionMonitorCamera.vue';
|
|
|
|
|
+ import ThumbnailClick from '@/components/thumbnail/ThumbnailClick.vue';
|
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
import { useUserInfoHook } from '@/hooks/useUserInfoHook';
|
|
import { useUserInfoHook } from '@/hooks/useUserInfoHook';
|
|
|
import { usePositionMonitorCameraEdit } from '@/store/modules/usePositionMonitorCameraEdit';
|
|
import { usePositionMonitorCameraEdit } from '@/store/modules/usePositionMonitorCameraEdit';
|
|
@@ -133,7 +143,7 @@
|
|
|
nameOfPosition,
|
|
nameOfPosition,
|
|
|
selectedCameraIdsOfPosition,
|
|
selectedCameraIdsOfPosition,
|
|
|
} = storeToRefs(positionMonitorCameraEdit);
|
|
} = storeToRefs(positionMonitorCameraEdit);
|
|
|
- const { initDataOfPosition } = positionMonitorCameraEdit;
|
|
|
|
|
|
|
+ const { initDataOfPosition, resetPositionMonitorCameraEdit } = positionMonitorCameraEdit;
|
|
|
|
|
|
|
|
const searchData = reactive<GetPositionListParams>({
|
|
const searchData = reactive<GetPositionListParams>({
|
|
|
groupName: '',
|
|
groupName: '',
|
|
@@ -152,46 +162,69 @@
|
|
|
const updatePositionMonitorCameraVisible = ref(false);
|
|
const updatePositionMonitorCameraVisible = ref(false);
|
|
|
|
|
|
|
|
const handleAddSecurityPosition = () => {
|
|
const handleAddSecurityPosition = () => {
|
|
|
- titleOfUpdatePositionMonitorCamera.value = '编辑重点监控部位';
|
|
|
|
|
|
|
+ titleOfUpdatePositionMonitorCamera.value = '添加重点监控部位';
|
|
|
dataOfPosition.value = undefined;
|
|
dataOfPosition.value = undefined;
|
|
|
|
|
+ initDataOfPosition();
|
|
|
updatePositionMonitorCameraVisible.value = true;
|
|
updatePositionMonitorCameraVisible.value = true;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
|
- console.log('查询治安重点部位');
|
|
|
|
|
if (searchSelectedType.value === FIELDTYPE.POSITION_NAME) searchData.groupName = searchKeyword.value;
|
|
if (searchSelectedType.value === FIELDTYPE.POSITION_NAME) searchData.groupName = searchKeyword.value;
|
|
|
else searchData.cameraName = searchKeyword.value;
|
|
else searchData.cameraName = searchKeyword.value;
|
|
|
getTableData();
|
|
getTableData();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const handleReset = () => {
|
|
|
|
|
+ searchKeyword.value = '';
|
|
|
|
|
+ searchSelectedType.value = FIELDTYPE.POSITION_NAME;
|
|
|
|
|
+ searchData.cameraName = '';
|
|
|
|
|
+ searchData.groupName = '';
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const handleSelectedTypeChange = () => {
|
|
const handleSelectedTypeChange = () => {
|
|
|
searchKeyword.value = '';
|
|
searchKeyword.value = '';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handleUpOne = (id: number, orderNum: number) => {
|
|
|
|
|
- console.log('上移治安重点部位', id);
|
|
|
|
|
- updateCameraGroupOrder({
|
|
|
|
|
- id: id,
|
|
|
|
|
- orderNum: orderNum - 1,
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
- console.log('上移治安重点部位', res);
|
|
|
|
|
- getTableData();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const handleUpOne = (currentRow: PositionMonitorCameraListRes, currentIndex: number) => {
|
|
|
|
|
+ // 获取上一行的数据
|
|
|
|
|
+ const prevRow = tableData.value[currentIndex - 1];
|
|
|
|
|
+ // 构造交换数据数组
|
|
|
|
|
+ const swapData = [
|
|
|
|
|
+ { id: prevRow.id, orderNum: currentRow.orderNum }, // 上一行使用当前行的orderNum
|
|
|
|
|
+ { id: currentRow.id, orderNum: prevRow.orderNum }, // 当前行使用上一行的orderNum
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ updateCameraGroupOrder(swapData)
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ ElMessage.success('上移成功');
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ ElMessage.error('上移失败');
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handleDownOne = (id: number, orderNum: number) => {
|
|
|
|
|
- console.log('下移治安重点部位', id);
|
|
|
|
|
- updateCameraGroupOrder({
|
|
|
|
|
- id: id,
|
|
|
|
|
- orderNum: orderNum + 1,
|
|
|
|
|
- }).then((res) => {
|
|
|
|
|
- console.log('下移治安重点部位', res);
|
|
|
|
|
- getTableData();
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ const handleDownOne = (currentRow: PositionMonitorCameraListRes, currentIndex: number) => {
|
|
|
|
|
+ // 获取下一行的数据
|
|
|
|
|
+ const nextRow = tableData.value[currentIndex + 1];
|
|
|
|
|
+ // 构造交换数据数组
|
|
|
|
|
+ const swapData = [
|
|
|
|
|
+ { id: nextRow.id, orderNum: currentRow.orderNum }, // 下一行使用当前行的orderNum
|
|
|
|
|
+ { id: currentRow.id, orderNum: nextRow.orderNum }, // 当前行使用下一行的orderNum
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ updateCameraGroupOrder(swapData)
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ ElMessage.success('下移成功');
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ ElMessage.error('下移失败');
|
|
|
|
|
+ });
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleEditSecurityPosition = (row: PositionMonitorCameraListRes) => {
|
|
const handleEditSecurityPosition = (row: PositionMonitorCameraListRes) => {
|
|
|
- console.log('编辑治安重点部位', row);
|
|
|
|
|
titleOfUpdatePositionMonitorCamera.value = '编辑重点监控部位';
|
|
titleOfUpdatePositionMonitorCamera.value = '编辑重点监控部位';
|
|
|
dataOfPosition.value = row;
|
|
dataOfPosition.value = row;
|
|
|
initDataOfPosition();
|
|
initDataOfPosition();
|
|
@@ -199,9 +232,8 @@
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleDeleteSecurityPosition = (id: number) => {
|
|
const handleDeleteSecurityPosition = (id: number) => {
|
|
|
- console.log('删除治安重点部位', id);
|
|
|
|
|
- deleteCameraGroupApi(id).then((res) => {
|
|
|
|
|
- console.log('删除治安重点部位', res);
|
|
|
|
|
|
|
+ deleteCameraGroupApi(id).then(() => {
|
|
|
|
|
+ ElMessage.success('治安重点部位删除成功');
|
|
|
getTableData();
|
|
getTableData();
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
@@ -218,23 +250,51 @@
|
|
|
getTableData();
|
|
getTableData();
|
|
|
});
|
|
});
|
|
|
updatePositionMonitorCameraVisible.value = false;
|
|
updatePositionMonitorCameraVisible.value = false;
|
|
|
|
|
+ resetPositionMonitorCameraEdit();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleClosePositionMonitorCamera = () => {
|
|
const handleClosePositionMonitorCamera = () => {
|
|
|
ElMessage.info('取消操作');
|
|
ElMessage.info('取消操作');
|
|
|
updatePositionMonitorCameraVisible.value = false;
|
|
updatePositionMonitorCameraVisible.value = false;
|
|
|
|
|
+ resetPositionMonitorCameraEdit();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const getTableData = () => {
|
|
const getTableData = () => {
|
|
|
tableConfig.loading = true;
|
|
tableConfig.loading = true;
|
|
|
getSecurityPositionList(searchData).then((res) => {
|
|
getSecurityPositionList(searchData).then((res) => {
|
|
|
- console.log('获取治安重点部位列表', res);
|
|
|
|
|
tableData.value = res;
|
|
tableData.value = res;
|
|
|
});
|
|
});
|
|
|
tableConfig.loading = false;
|
|
tableConfig.loading = false;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ // 当前选中的治安重点部位id和相机code
|
|
|
|
|
+ const activePositionId = ref(0);
|
|
|
|
|
+ const activeCameraCode = ref('');
|
|
|
|
|
+ const handleCameraClick = (id: number, code: string) => {
|
|
|
|
|
+ activePositionId.value = id;
|
|
|
|
|
+ activeCameraCode.value = code;
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleMouseEnter = (code: string) => {
|
|
|
|
|
+ activeCameraCode.value = code;
|
|
|
|
|
+ };
|
|
|
|
|
+ const handleMouseLeave = () => {
|
|
|
|
|
+ activeCameraCode.value = '';
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 动态生成表格列配置
|
|
|
|
|
+ const getTableColumns = () => {
|
|
|
|
|
+ if (securityPositionManagePermission.value) {
|
|
|
|
|
+ return SECURITY_POSITION_LIST_TABLE_COLUMNS;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 过滤掉操作列
|
|
|
|
|
+ return SECURITY_POSITION_LIST_TABLE_COLUMNS.filter(
|
|
|
|
|
+ (column) => column.prop !== 'action' && column.type !== 'selection',
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
|
+ getTableData();
|
|
|
securityPositionManagePermission.value = Boolean(
|
|
securityPositionManagePermission.value = Boolean(
|
|
|
permissions.find(
|
|
permissions.find(
|
|
|
(item: { code: string }) => item.code === SECURITY_CONFIDENTIALITY_PERMISSIONS.SECURITY_POSITION_MANAGEMENT,
|
|
(item: { code: string }) => item.code === SECURITY_CONFIDENTIALITY_PERMISSIONS.SECURITY_POSITION_MANAGEMENT,
|
|
@@ -243,12 +303,36 @@
|
|
|
tableConfig.maxHeight = securityPositionManagePermission.value
|
|
tableConfig.maxHeight = securityPositionManagePermission.value
|
|
|
? SECURITY_POSITION_LIST_TABLE_MAX_HEIGHT_PERMISSION
|
|
? SECURITY_POSITION_LIST_TABLE_MAX_HEIGHT_PERMISSION
|
|
|
: SECURITY_POSITION_LIST_TABLE_MAX_HEIGHT_DEFAULT;
|
|
: SECURITY_POSITION_LIST_TABLE_MAX_HEIGHT_DEFAULT;
|
|
|
|
|
+ tableConfig.columns = getTableColumns();
|
|
|
});
|
|
});
|
|
|
- getTableData();
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
@use '@/styles/page-main-layout.scss' as *;
|
|
@use '@/styles/page-main-layout.scss' as *;
|
|
|
@use '@/styles/page-details-layout.scss' as *;
|
|
@use '@/styles/page-details-layout.scss' as *;
|
|
|
@use '@/styles/basic-table-action.scss' as *;
|
|
@use '@/styles/basic-table-action.scss' as *;
|
|
|
|
|
+
|
|
|
|
|
+ .action-container--div {
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .camera-name-container {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 10px;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .camera-name-container .thumb-nail {
|
|
|
|
|
+ color: #1777ff;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .camera-name-container .thumb-nail:hover {
|
|
|
|
|
+ color: #94c1ff;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .camera-name-container .active {
|
|
|
|
|
+ color: #003f97;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|