|
@@ -45,6 +45,19 @@
|
|
|
@update:pageSize="handleSizeChange"
|
|
@update:pageSize="handleSizeChange"
|
|
|
@update:pageNumber="handleCurrentChange"
|
|
@update:pageNumber="handleCurrentChange"
|
|
|
>
|
|
>
|
|
|
|
|
+ <template #images="scope">
|
|
|
|
|
+ <ImageViewer :file-list="scope.row.images" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #actions="scope">
|
|
|
|
|
+ <ActionButton text="编辑" @click="handleEditRecord(scope.row.id)" />
|
|
|
|
|
+ <ActionButton
|
|
|
|
|
+ text="删除"
|
|
|
|
|
+ :popconfirm="{
|
|
|
|
|
+ title: '确定要删除?',
|
|
|
|
|
+ }"
|
|
|
|
|
+ @confirm="handleDeleteRecord(scope.row.id)"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
</BasicTable>
|
|
</BasicTable>
|
|
|
</div>
|
|
</div>
|
|
|
</main>
|
|
</main>
|
|
@@ -56,18 +69,26 @@
|
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
|
import SelectableInput from '@/components/formItems/selectableInput/SelectableInput.vue';
|
|
import SelectableInput from '@/components/formItems/selectableInput/SelectableInput.vue';
|
|
|
|
|
+ import ImageViewer from '@/views/traffic/violation/act/components/ImageViewer.vue';
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
|
import { Plus } from '@element-plus/icons-vue';
|
|
import { Plus } from '@element-plus/icons-vue';
|
|
|
|
|
+ import { ElMessage } from 'element-plus';
|
|
|
|
|
+ import { downloadFile } from '@/views/disaster/utils';
|
|
|
import { useUserInfoHook } from '@/hooks/useUserInfoHook';
|
|
import { useUserInfoHook } from '@/hooks/useUserInfoHook';
|
|
|
- import { ACCESS_MANAGEMENT_PERMISSION, ACCESS_TABLE_SEARCH_OPTIONS } from './constant';
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ getAccessRecordList,
|
|
|
|
|
+ exportAccessRecordList,
|
|
|
|
|
+ deleteAccessRecord,
|
|
|
|
|
+ } from '@/api/security-confidentiality-access';
|
|
|
|
|
+ import { ACCESS_MANAGEMENT_PERMISSION, ACCESS_TABLE_SEARCH_OPTIONS } from './constants';
|
|
|
import { TABLE_OPTIONS, ACCESS_TABEL_COLUMNS, ACCESS_TABEL_COLUMNS_CHECKONLY } from './configs/tables';
|
|
import { TABLE_OPTIONS, ACCESS_TABEL_COLUMNS, ACCESS_TABEL_COLUMNS_CHECKONLY } from './configs/tables';
|
|
|
- import type { AccessTableData, AccessTableQuery } from './types';
|
|
|
|
|
|
|
+ import type { AccessDetailResponse, AccessTableQuery } from './types';
|
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
import type { QueryPageRequest } from '@/types/basic-query';
|
|
|
|
|
|
|
|
const { permissions } = useUserInfoHook();
|
|
const { permissions } = useUserInfoHook();
|
|
|
const managementPermission = ref<Boolean>(
|
|
const managementPermission = ref<Boolean>(
|
|
|
- Boolean(permissions.find((item: { code: string }) => item.code === ACCESS_MANAGEMENT_PERMISSION)),
|
|
|
|
|
|
|
+ !Boolean(permissions.find((item: { code: string }) => item.code === ACCESS_MANAGEMENT_PERMISSION)),
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -80,17 +101,22 @@
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const searchData = reactive<AccessTableQuery>({});
|
|
|
|
|
const searchTime = ref<string[]>([]);
|
|
const searchTime = ref<string[]>([]);
|
|
|
const selectableInputRef = ref<InstanceType<typeof SelectableInput>>();
|
|
const selectableInputRef = ref<InstanceType<typeof SelectableInput>>();
|
|
|
function getQuery() {
|
|
function getQuery() {
|
|
|
- // TODO
|
|
|
|
|
|
|
+ const selectableSearch = selectableInputRef.value?.getValue();
|
|
|
|
|
+ tableQuery.queryParam = {
|
|
|
|
|
+ fieldType: selectableSearch?.key as number | null,
|
|
|
|
|
+ fieldContent: selectableSearch?.value,
|
|
|
|
|
+ startTime: searchTime.value[0],
|
|
|
|
|
+ endTime: searchTime.value[1],
|
|
|
|
|
+ };
|
|
|
}
|
|
}
|
|
|
async function getTableData() {
|
|
async function getTableData() {
|
|
|
tableConfig.loading = true;
|
|
tableConfig.loading = true;
|
|
|
- // const res = await getInnerPersonRecordList(tableQuery);
|
|
|
|
|
- // tableData.value = res.records;
|
|
|
|
|
- // pagination.total = res.totalRow;
|
|
|
|
|
|
|
+ const res = await getAccessRecordList(tableQuery);
|
|
|
|
|
+ tableData.value = res.records;
|
|
|
|
|
+ pagination.total = res.totalRow;
|
|
|
tableConfig.loading = false;
|
|
tableConfig.loading = false;
|
|
|
}
|
|
}
|
|
|
function handleSearch() {
|
|
function handleSearch() {
|
|
@@ -100,9 +126,9 @@
|
|
|
|
|
|
|
|
function handleReset() {
|
|
function handleReset() {
|
|
|
selectableInputRef.value?.clearValue();
|
|
selectableInputRef.value?.clearValue();
|
|
|
- for (const key in searchData) {
|
|
|
|
|
- if (searchData.hasOwnProperty(key)) {
|
|
|
|
|
- searchData[key] = undefined;
|
|
|
|
|
|
|
+ for (const key in tableQuery.queryParam) {
|
|
|
|
|
+ if (tableQuery.queryParam.hasOwnProperty(key)) {
|
|
|
|
|
+ tableQuery.queryParam[key] = undefined;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
searchTime.value = [];
|
|
searchTime.value = [];
|
|
@@ -110,17 +136,17 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async function handleDownload() {
|
|
async function handleDownload() {
|
|
|
- // getQuery();
|
|
|
|
|
- // try {
|
|
|
|
|
- // const res = await exportInnerPersonRecordList(tableQuery.queryParam);
|
|
|
|
|
- // if (res.size === 0) return;
|
|
|
|
|
- // const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
|
|
|
- // const url = window.URL.createObjectURL(blob);
|
|
|
|
|
- // downloadFile(url, '内部人员门禁出入记录.xlsx');
|
|
|
|
|
- // } catch (e) {
|
|
|
|
|
- // ElMessage.error('下载失败');
|
|
|
|
|
- // console.log(e);
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ getQuery();
|
|
|
|
|
+ try {
|
|
|
|
|
+ const res = await exportAccessRecordList(tableQuery.queryParam);
|
|
|
|
|
+ if (res.size === 0) return;
|
|
|
|
|
+ const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
|
|
|
+ const url = window.URL.createObjectURL(blob);
|
|
|
|
|
+ downloadFile(url, '内部人员门禁出入记录.xlsx');
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ ElMessage.error('下载失败');
|
|
|
|
|
+ console.log(e);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 表格
|
|
// 表格
|
|
@@ -128,24 +154,48 @@
|
|
|
managementPermission.value ? ACCESS_TABEL_COLUMNS : ACCESS_TABEL_COLUMNS_CHECKONLY,
|
|
managementPermission.value ? ACCESS_TABEL_COLUMNS : ACCESS_TABEL_COLUMNS_CHECKONLY,
|
|
|
TABLE_OPTIONS,
|
|
TABLE_OPTIONS,
|
|
|
);
|
|
);
|
|
|
- const tableData = ref<AccessTableData[]>([]);
|
|
|
|
|
|
|
+ const tableData = ref<AccessDetailResponse[]>([]);
|
|
|
|
|
|
|
|
- const tableQuery = ref<QueryPageRequest<AccessTableQuery>>({
|
|
|
|
|
|
|
+ const tableQuery = reactive<QueryPageRequest<AccessTableQuery>>({
|
|
|
pageNumber: pagination.pageNumber,
|
|
pageNumber: pagination.pageNumber,
|
|
|
pageSize: pagination.pageSize,
|
|
pageSize: pagination.pageSize,
|
|
|
- queryParam: searchData,
|
|
|
|
|
|
|
+ queryParam: {},
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const handleSizeChange = (value: number) => {
|
|
const handleSizeChange = (value: number) => {
|
|
|
pagination.pageSize = value;
|
|
pagination.pageSize = value;
|
|
|
- tableQuery.value.pageSize = value;
|
|
|
|
|
|
|
+ tableQuery.pageSize = value;
|
|
|
getTableData();
|
|
getTableData();
|
|
|
};
|
|
};
|
|
|
const handleCurrentChange = (value: number) => {
|
|
const handleCurrentChange = (value: number) => {
|
|
|
pagination.pageNumber = value;
|
|
pagination.pageNumber = value;
|
|
|
- tableQuery.value.pageNumber = value;
|
|
|
|
|
|
|
+ tableQuery.pageNumber = value;
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleEditRecord = (id: number) => {
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ name: 'security-confidentiality-access-control-item',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ operate: 'access-edit',
|
|
|
|
|
+ id,
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleDeleteRecord = async (id: number) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ await deleteAccessRecord(id);
|
|
|
|
|
+ ElMessage.success('删除成功');
|
|
|
|
|
+ } catch (e) {
|
|
|
|
|
+ ElMessage.error('删除失败');
|
|
|
|
|
+ }
|
|
|
getTableData();
|
|
getTableData();
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ onMounted(() => {
|
|
|
|
|
+ getTableData();
|
|
|
|
|
+ });
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|