diff --git a/src/api/data/pictureInfo.js b/src/api/data/pictureInfo.js index da6be7c..e29d8c2 100644 --- a/src/api/data/pictureInfo.js +++ b/src/api/data/pictureInfo.js @@ -40,7 +40,7 @@ export const getPicturePage = (current,size,params) => { }; /** - * 上传基础数据 + * 上传图片数据 * @param data * @returns {Promise>} */ @@ -55,12 +55,25 @@ export const uploadData = (data) => { }); }; +/** + * 更新图片数据 + * @param data + * @returns {Promise>} + */ +export const updatePicture = (data) => { + return request({ + url: '/api/' + moduleName + '/ui/pictureInfo/update', + method: 'put', + headers: { + 'Content-Type': 'multipart/form-data' + }, + data: data + }); +} /** - * 根据灾害id查询图片数据 - * @param current - * @param size - * @param params + * 删除图片数据 + * @param id * @returns {Promise>} */ export const delPicture = (id) => { diff --git a/src/api/data/visualData.js b/src/api/data/visualData.js index 0bbdf77..afcdd0e 100644 --- a/src/api/data/visualData.js +++ b/src/api/data/visualData.js @@ -84,6 +84,32 @@ export const auditData = (data) => { }); }; +/** + * 更新词云数据 + * @param row + * @returns {Promise>} + */ +export const updateWordCloud = (row) => { + return request({ + url: '/api' + moduleName + '/ui/visualData/updateWordCloud', + method: 'put', + data: row + }) +} + +/** + * 更新热点数据 + * @param row + * @returns {Promise>} + */ +export const updateHotspot = (row) => { + return request({ + url: '/api' + moduleName + '/ui/visualData/updateHotspot', + method: 'put', + data: row + }) +} + /** * 根据灾害id查询图片数据 diff --git a/src/views/dataService/otherData/index.vue b/src/views/dataService/otherData/index.vue index 8112ab1..669d01c 100644 --- a/src/views/dataService/otherData/index.vue +++ b/src/views/dataService/otherData/index.vue @@ -1,5 +1,6 @@ + + + + \ No newline at end of file diff --git a/src/views/dataService/pictureInfo/component/upload.vue b/src/views/dataService/pictureInfo/component/upload.vue index e7b7f4b..3a7a01a 100644 --- a/src/views/dataService/pictureInfo/component/upload.vue +++ b/src/views/dataService/pictureInfo/component/upload.vue @@ -58,10 +58,6 @@ const state = reactive({ isShowDialog: false, isLoading:false, ruleForm: { - name: '', //标样名称 - code: '',//标样编号 - states: '',//标样状态 - tableData: [], }, tableData: [], //字典值 diff --git a/src/views/dataService/pictureInfo/index.vue b/src/views/dataService/pictureInfo/index.vue index 256004e..e76d3a8 100644 --- a/src/views/dataService/pictureInfo/index.vue +++ b/src/views/dataService/pictureInfo/index.vue @@ -1,5 +1,6 @@ + + \ No newline at end of file diff --git a/src/views/dataService/visualData/component/editWordCloudForm.vue b/src/views/dataService/visualData/component/editWordCloudForm.vue new file mode 100644 index 0000000..f6a6358 --- /dev/null +++ b/src/views/dataService/visualData/component/editWordCloudForm.vue @@ -0,0 +1,129 @@ + + + + + \ No newline at end of file diff --git a/src/views/dataService/visualData/component/hotspotForm.vue b/src/views/dataService/visualData/component/hotspotForm.vue index 78e4b11..99c72b4 100644 --- a/src/views/dataService/visualData/component/hotspotForm.vue +++ b/src/views/dataService/visualData/component/hotspotForm.vue @@ -4,7 +4,7 @@ - + diff --git a/src/views/dataService/visualData/index.vue b/src/views/dataService/visualData/index.vue index ad5d532..88e1e11 100644 --- a/src/views/dataService/visualData/index.vue +++ b/src/views/dataService/visualData/index.vue @@ -1,5 +1,6 @@ @@ -137,24 +156,15 @@ import type { TabsPaneContext } from 'element-plus'; import HotspotForm from './component/hotspotForm.vue'; import WordClouds from './component/wordCloudForm.vue'; +import EditHotspotForm from './component/editHotspotForm.vue'; +import EditWordCloudsForm from './component/editWordCloudForm.vue'; import {getWordClouds,getHotspot,getDisasterPage,delData} from '/@/api/data/visualData.js'; +import en from 'element-plus/dist/locale/en.mjs' const activeName = ref('first'); const hotspotRef = ref(); const wordCloudsRef = ref(); -const handleClick = (tab) => { - state.tabVal = tab; - state. tableData={ - data: [], - total: 0, - loading: false, - param: { - search: '', - pageNum: 1, - pageSize: 10, - }, - } - getTableData(); -}; +const editHotspotRef = ref(); +const editWordCloudsRef = ref(); //复制内容 import { defineAsyncComponent, reactive, onMounted, ref } from 'vue'; @@ -166,6 +176,8 @@ const uploadRef = ref(); // 定义变量内容 const roleDialogRef = ref(); const state = reactive({ + multipleWord:[], + multipleHotspot:[], tabVal:'first', disasterId:null, disasterData: { @@ -189,6 +201,28 @@ const state = reactive({ }, }, }); + +const handleSelectionChange = (val) => { + state.multipleWord = val +} + +const handleSelectionHotspotChange = (val) => { + state.multipleHotspot = val +} +const handleClick = (tab) => { + state.tabVal = tab; + state. tableData={ + data: [], + total: 0, + loading: false, + param: { + search: '', + pageNum: 1, + pageSize: 10, + }, + } + getTableData(); +}; const auditData = (row) => { let id = row.id auditRef.value.openDialog([{"id":id}]); @@ -262,10 +296,48 @@ const uploadData = () => { } state.tabVal == 'first' ? wordCloudsRef.value.openDialog(state.disasterId) : hotspotRef.value.openDialog(state.disasterId); }; -// 打开修改角色弹窗 -const onOpenEditRole = (type, row) => { - roleDialogRef.value.openDialog(type, row); +// 打开修改热点弹窗 +const editHotspot = (row) => { + editHotspotRef.value.openDialog(row); }; +// 打开修改词云弹窗 +const editWordCloud = (row) => { + editWordCloudsRef.value.openDialog(row); +}; +//批量删除词云或者热点数据 +const batchDel = () => { + if(state.tabVal == 'first' && state.multipleWord.length == 0){ + ElMessage.warning("Select the data to be operated first"); + return false; + } + if(state.tabVal == 'second' && state.multipleHotspot.length == 0){ + ElMessage.warning("Select the data to be operated first"); + return false; + } + ElMessageBox.confirm(`This action batch deletes the data,Whether to continue?`, 'tip', { + confirmButtonText: 'confirm', + cancelButtonText: 'cancel', + type: 'warning', + }) + .then(() => { + if(state.tabVal == 'first'){ + //删除词云 + let id = state.multipleWord.map(item=>item.id) + delData(id.join(),1).then(res=>{ + getTableData(); + ElMessage.success('delete successfully'); + }) + }else{ + //删除热点 + let id = state.multipleHotspot.map(item=>item.id) + delData(id.join(),2).then(res=>{ + getTableData(); + ElMessage.success('delete successfully'); + }) + } + }) + .catch(() => {}); +} // 删除词云 const delWordCloud = (row) => { ElMessageBox.confirm(`This action deletes the word cloud:“${row.word}”,Whether to continue?`, 'tip', { diff --git a/src/views/responseManagement/dataUpload/index.vue b/src/views/responseManagement/dataUpload/index.vue index 292b704..38e607a 100644 --- a/src/views/responseManagement/dataUpload/index.vue +++ b/src/views/responseManagement/dataUpload/index.vue @@ -14,8 +14,11 @@ - +
+ + @@ -105,6 +118,7 @@ const auditRef = ref(); // 定义变量内容 const roleDialogRef = ref(); const state = reactive({ + multipleSelection:[], disasterId:null, disasterData: { data: [], @@ -127,6 +141,17 @@ const state = reactive({ }, }, }); +const handleSelectionChange = (val) => { + state.multipleSelection = val +} +//批量审核普通管理员数据 +const batchAudit = () => { + if(state.multipleSelection.length == 0){ + ElMessage.warning("Select the data to be operated first"); + return false; + } + auditRef.value.openDialog(state.multipleSelection); +} const auditData = (row) => { let id = row.id auditRef.value.openDialog([{"id":id}]); diff --git a/src/views/systemManagement/administrator/index.vue b/src/views/systemManagement/administrator/index.vue index 7f3ad17..86ee0f7 100644 --- a/src/views/systemManagement/administrator/index.vue +++ b/src/views/systemManagement/administrator/index.vue @@ -10,16 +10,18 @@ search - + batch audit +
+ @@ -90,6 +92,7 @@ const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialo // 定义变量内容 const roleDialogRef = ref(); const state = reactive({ + multipleSelection:[], searchName:'', tableData: { data: [], @@ -102,6 +105,9 @@ const state = reactive({ }, }, }); +const handleSelectionChange = (val) => { + state.multipleSelection = val +} //审核管理者可以管理这个灾害 const auditManager = (row) => { auditRef.value.openDialog([{...row}]); @@ -138,7 +144,15 @@ const addUser = () => { const onOpenEditRole = (type, row) => { roleDialogRef.value.openDialog(type, row); }; -// 删除角色 +//批量审核普通管理员数据 +const batchAudit = () => { + if(state.multipleSelection.length == 0){ + ElMessage.warning("Select the data to be operated first"); + return false; + } + auditRef.value.openDialog(state.multipleSelection); +} +// 删除普通管理员 const deleteUser = (row) => { ElMessageBox.confirm(`This operation will delete the user:“${row.name}”,Whether to continue?`, 'tip', { confirmButtonText: 'confirm', diff --git a/src/views/systemManagement/chiefAdministrator/index.vue b/src/views/systemManagement/chiefAdministrator/index.vue index f7644fb..254201c 100644 --- a/src/views/systemManagement/chiefAdministrator/index.vue +++ b/src/views/systemManagement/chiefAdministrator/index.vue @@ -16,10 +16,18 @@ add + + + + + batch delete + + @@ -94,6 +102,7 @@ const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialo // 定义变量内容 const roleDialogRef = ref(); const state = reactive({ + multipleSelection:[], searchName:'', tableData: { data: [], @@ -106,6 +115,9 @@ const state = reactive({ }, }, }); +const handleSelectionChange = (val) => { + state.multipleSelection = val +} // 初始化表格数据 const getTableData = () => { state.tableData.loading = true; @@ -118,7 +130,7 @@ const getTableData = () => { state.tableData.loading = false; }, 500); }; -// 打开新增角色弹窗 +// 打开新增chief管理员弹窗 const addUser = () => { administratorRef.value.openDialog(); }; @@ -126,7 +138,27 @@ const addUser = () => { const onOpenEditRole = (type, row) => { roleDialogRef.value.openDialog(type, row); }; -// 删除角色 +//批量删除chief管理员数据 +const batchDel = () => { + if(state.multipleSelection.length == 0){ + ElMessage.warning("Select the data to be operated first"); + return false; + } + ElMessageBox.confirm(`This action batch deletes the chief data,Whether to continue?`, 'tip', { + confirmButtonText: 'confirm', + cancelButtonText: 'cancel', + type: 'warning', + }) + .then(() => { + let id = state.multipleSelection.map(item=>item.id) + remove(id.join()).then(res=>{ + getTableData(); + ElMessage.success('delete successfully'); + }) + }) + .catch(() => {}); +} +// 删除chief管理员数据 const deleteUser = (row) => { ElMessageBox.confirm(`This operation will delete the user:“${row.name}”,Whether to continue?`, 'tip', { confirmButtonText: 'confirm',