diff --git a/src/views/dataService/otherData/index.vue b/src/views/dataService/otherData/index.vue index 2ba96b2..57a57b6 100644 --- a/src/views/dataService/otherData/index.vue +++ b/src/views/dataService/otherData/index.vue @@ -1,120 +1,83 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - search - - - - - - upload - - - - - - batch delete - + + + + + + + + + + + - - - - - - - - - {{formatSizeUnits(scope.row.size)}} - - - - - - Delete - - - - - - - - + + + + + + + + + + + + + + search + + + + + + upload + + + + + + batch delete + + + + + + + + + + + {{ formatSizeUnits(scope.row.size) }} + + + + + + Delete + + + + + + + + - - + + @@ -122,7 +85,7 @@ import en from 'element-plus/dist/locale/en.mjs' import type { TabsPaneContext } from 'element-plus'; import Upload from './component/upload.vue'; -import {getOtherDataPage,getDisasterPage,deleteData} from '/@/api/data/otherData.js' +import { getOtherDataPage, getDisasterPage, deleteData } from '/@/api/data/otherData.js' const activeName = ref('first'); //复制内容 @@ -135,9 +98,9 @@ const uploadRef = ref(); // 定义变量内容 const roleDialogRef = ref(); const state = reactive({ - multipleSelection:[], - searchName:'', - disasterId:null, + multipleSelection: [], + searchName: '', + disasterId: null, disasterData: { data: [], total: 0, @@ -164,7 +127,7 @@ const handleSelectionChange = (val) => { } const auditData = (row) => { let id = row.id - auditRef.value.openDialog([{"id":id}]); + auditRef.value.openDialog([{ "id": id }]); } //格式化字节 const formatSize = (size) => { @@ -189,8 +152,8 @@ const formatSize = (size) => { const formatSizeUnits = (size) => { if (size === 0) return '0 B'; var k = 1000, // or 1024 - sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], - i = Math.floor(Math.log(size) / Math.log(k)); + sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'], + i = Math.floor(Math.log(size) / Math.log(k)); return (size / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i]; } @@ -202,7 +165,7 @@ const tableClick = (row, column, event) => { // 初始化灾害表格数据 const getDisasterData = () => { state.disasterData.loading = true; - getDisasterPage(state.disasterData.param.pageNum,state.disasterData.param.pageSize,{}).then(res=>{ + getDisasterPage(state.disasterData.param.pageNum, state.disasterData.param.pageSize, {}).then(res => { state.disasterData.data = res.records; state.disasterData.total = res.total; state.disasterData.loading = false; @@ -212,7 +175,9 @@ const getDisasterData = () => { // 初始化表格数据 const getTableData = () => { state.tableData.loading = true; - getOtherDataPage(state.tableData.param.pageNum,state.tableData.param.pageSize,{"disasterId":state.disasterId,"type":state.searchName,"isDeleted":0}).then(res=>{ + getOtherDataPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { "disasterId": state.disasterId, "type": state.searchName, "isDeleted": 0 }).then(res => { + console.log(res); + state.tableData.data = res.records; state.tableData.total = res.total; }) @@ -224,7 +189,7 @@ const getTableData = () => { }; // 打开上传弹窗 const uploadData = () => { - if(state.disasterId == null){ + if (state.disasterId == null) { ElMessage.warning("Please select the disaster first") return false; } @@ -236,23 +201,23 @@ const onOpenEditRole = (type, row) => { }; //批量删除其他数据 const batchDel = () => { - if(state.multipleSelection.length == 0){ + if (state.multipleSelection.length == 0) { ElMessage.warning("Select the data to be operated first"); return false; } - ElMessageBox.confirm(`This action batch deletes the other data,Whether to continue?`, 'tip', { + ElMessageBox.confirm(`This action batch deletes the other data,Whether to continue?`, 'tip', { confirmButtonText: 'confirm', cancelButtonText: 'cancel', type: 'warning', }) - .then(() => { - let id = state.multipleSelection.map(item=>item.id) - deleteData(id.join()).then(res=>{ - getTableData(); - ElMessage.success('delete successfully'); - }) + .then(() => { + let id = state.multipleSelection.map(item => item.id) + deleteData(id.join()).then(res => { + getTableData(); + ElMessage.success('delete successfully'); }) - .catch(() => {}); + }) + .catch(() => { }); } // 删除其他数据 const del = (row) => { @@ -261,13 +226,13 @@ const del = (row) => { cancelButtonText: 'cancel', type: 'warning', }) - .then(() => { - deleteData(row.id).then(res=>{ - getTableData(); - ElMessage.success('delete successfully'); - }) + .then(() => { + deleteData(row.id).then(res => { + getTableData(); + ElMessage.success('delete successfully'); }) - .catch(() => {}); + }) + .catch(() => { }); }; // 分页改变 const onHandleDisasterSizeChange = (val) => { @@ -296,7 +261,7 @@ onMounted(() => { }); diff --git a/src/views/responseManagement/tool/index.vue b/src/views/responseManagement/tool/index.vue index cab9478..1d6781a 100644 --- a/src/views/responseManagement/tool/index.vue +++ b/src/views/responseManagement/tool/index.vue @@ -14,7 +14,7 @@ - + diff --git a/src/views/responseManagement/userResponse/index.vue b/src/views/responseManagement/userResponse/index.vue index 4b0a9a8..5116578 100644 --- a/src/views/responseManagement/userResponse/index.vue +++ b/src/views/responseManagement/userResponse/index.vue @@ -78,14 +78,13 @@ - - - - {{ dateFormat(scope.row.disasterTime) }} - - - + --> + + + + {{ dateFormat(scope.row.disasterTime) }} + + @@ -97,11 +96,24 @@ - - - Allocation - - + + - + - Point - Area + Point + Area Clear Latitude: - + Longitude: - + - + @@ -141,40 +153,30 @@ -