From bee20073435254ff15e4273fe72c65b6b8f27877 Mon Sep 17 00:00:00 2001 From: liyuchen <791867849@qq.com> Date: Fri, 14 Apr 2023 16:59:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=B9=E9=87=8F=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=92=8C=E6=89=B9=E9=87=8F=E5=AE=A1=E6=A0=B8=E5=8A=9F?= =?UTF-8?q?=E8=83=BD-liyuchen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/data/pictureInfo.js | 23 +- src/api/data/visualData.js | 26 ++ src/views/dataService/otherData/index.vue | 48 +++- .../pictureInfo/component/editPicture.vue | 224 ++++++++++++++++++ .../pictureInfo/component/upload.vue | 4 - src/views/dataService/pictureInfo/index.vue | 72 +++++- .../visualData/component/editHotspotForm.vue | 123 ++++++++++ .../component/editWordCloudForm.vue | 129 ++++++++++ .../visualData/component/hotspotForm.vue | 2 +- src/views/dataService/visualData/index.vue | 110 +++++++-- .../responseManagement/dataUpload/index.vue | 29 ++- .../systemManagement/administrator/index.vue | 24 +- .../chiefAdministrator/index.vue | 36 ++- 13 files changed, 797 insertions(+), 53 deletions(-) create mode 100644 src/views/dataService/pictureInfo/component/editPicture.vue create mode 100644 src/views/dataService/visualData/component/editHotspotForm.vue create mode 100644 src/views/dataService/visualData/component/editWordCloudForm.vue 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',