This commit is contained in:
glj 2023-05-25 18:08:55 +08:00
commit 43f4b2f043
10 changed files with 181 additions and 19 deletions

22
package-lock.json generated
View File

@ -3007,6 +3007,14 @@
"resolved": "https://registry.npmmirror.com/leaflet/-/leaflet-1.9.3.tgz", "resolved": "https://registry.npmmirror.com/leaflet/-/leaflet-1.9.3.tgz",
"integrity": "sha512-iB2cR9vAkDOu5l3HAay2obcUHZ7xwUBBjph8+PGtmW/2lYhbLizWtG7nTeYht36WfOslixQF9D/uSIzhZgGMfQ==" "integrity": "sha512-iB2cR9vAkDOu5l3HAay2obcUHZ7xwUBBjph8+PGtmW/2lYhbLizWtG7nTeYht36WfOslixQF9D/uSIzhZgGMfQ=="
}, },
"leaflet-control-geocoder": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/leaflet-control-geocoder/-/leaflet-control-geocoder-2.4.0.tgz",
"integrity": "sha512-b2QlxuFd40uIDbnoUI3U9fzfnB4yKUYlmsXjquJ2d2YjoJqnyVYcIJeErAVv3kPvX3nI0gzvBq1XHMgSVFrGkQ==",
"requires": {
"open-location-code": "^1.0.0"
}
},
"leaflet-draw": { "leaflet-draw": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/leaflet-draw/-/leaflet-draw-1.0.4.tgz", "resolved": "https://registry.npmjs.org/leaflet-draw/-/leaflet-draw-1.0.4.tgz",
@ -3020,6 +3028,14 @@
"leaflet": "^1.0.0" "leaflet": "^1.0.0"
} }
}, },
"leaflet-search": {
"version": "2.9.6",
"resolved": "https://registry.npmjs.org/leaflet-search/-/leaflet-search-2.9.6.tgz",
"integrity": "sha512-ZzZEnjcYmVEXfYq5r2adt47voAtycJlZ3YDjWJXjJuUCWW99sj6IqB5qjNrBC5JALBmSnkOlfSHCaj3jbO1CGg==",
"requires": {
"leaflet": "*"
}
},
"levn": { "levn": {
"version": "0.4.1", "version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
@ -3199,6 +3215,12 @@
"wrappy": "1" "wrappy": "1"
} }
}, },
"open-location-code": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/open-location-code/-/open-location-code-1.0.3.tgz",
"integrity": "sha512-DBm14BSn40Ee241n80zIFXIT6+y8Tb0I+jTdosLJ8Sidvr2qONvymwqymVbHV2nS+1gkDZ5eTNpnOIVV0Kn2fw==",
"optional": true
},
"optimist": { "optimist": {
"version": "0.6.1", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",

View File

@ -88,3 +88,10 @@ export function responseEndedDisasterInfo(id) {
} }
}); });
} }
export function deleteByIds(ids) {
return request({
url: '/api/' + moduleName + '/ui/disasterInfo/deleteByIds',
method: 'delete',
data: ids
});
}

View File

@ -32,3 +32,10 @@ export const importTemplate = (data) => {
data: data data: data
}) })
} }
export const remove = (ids,type) => {
return request({
url: '/api/'+moduleName+'/ui/'+(type?'news':'socialMedia')+'/deleteByIds',
method: 'delete',
data: ids
})
}

View File

@ -46,6 +46,13 @@ export const importTemplate = (data) => {
data: data data: data
}); });
}; };
export const removeList = (ids) => {
return request({
url: '/api/' + moduleName + '/ui/remoteSensing/remove',
method: 'delte',
data: ids,
});
}
export const importTemplateImgList = (data) => { export const importTemplateImgList = (data) => {
return request({ return request({
@ -54,4 +61,4 @@ export const importTemplateImgList = (data) => {
method: 'post', method: 'post',
data: data data: data
}); });
}; };

View File

@ -50,4 +50,11 @@ export const auditData = (data) => {
method: 'post', method: 'post',
data: data data: data
}); });
}; };
export const remove = (data) => {
return request({
url: '/api/' + moduleName + '/ui/dataUpload/remove',
method: 'delete',
data: data
});
}

View File

@ -15,6 +15,12 @@ export function authDirective(app) {
if (!stores.userInfos.authBtnList.some((v) => v === binding.value)) el.parentNode.removeChild(el); if (!stores.userInfos.authBtnList.some((v) => v === binding.value)) el.parentNode.removeChild(el);
}, },
}); });
app.directive('auth-role', {
mounted(el, binding) {
const stores = useUserInfo();
if (!stores.userInfos.roles.some((v) => v === binding.value)) el.parentNode.removeChild(el);
},
});
// 多个权限验证满足一个则显示v-auths="[xxx,xxx]" // 多个权限验证满足一个则显示v-auths="[xxx,xxx]"
app.directive('auths', { app.directive('auths', {
mounted(el, binding) { mounted(el, binding) {

View File

@ -57,6 +57,12 @@
</el-icon> </el-icon>
Upload Upload
</el-button> </el-button>
<el-button size="default" type="danger" v-auth-role="'admin'" class="ml10" @click="removeThis">
<el-icon>
<ele-Delete />
</el-icon>
Delete
</el-button>
</div> </div>
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" <el-table :data="state.tableData.data" v-loading="state.tableData.loading"
@ -120,15 +126,14 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="dataMultimediaData"> <script setup name="dataMultimediaData">
import en from 'element-plus/dist/locale/en.mjs' import en from 'element-plus/dist/locale/en.mjs'
import type { TabsPaneContext } from 'element-plus';
import { getList } from '/@/api/disasterInfo/index'; import { getList } from '/@/api/disasterInfo/index';
import { getList as getNewsList, review } from '/@/api/news/index'; import { getList as getNewsList, review , remove as removeList} from '/@/api/news/index';
import { getDictionary } from '/@/api/system/dictbiz'; import { getDictionary } from '/@/api/system/dictbiz';
// //
import { reactive, onMounted, ref } from 'vue'; import { reactive, onMounted, ref } from 'vue';
import { ElMessage } from 'element-plus'; import { ElMessage ,ElMessageBox} from 'element-plus';
import boot from "./component/boot.vue"; import boot from "./component/boot.vue";
import uploadData from "./component/uploadData.vue"; import uploadData from "./component/uploadData.vue";
@ -136,7 +141,27 @@ import disasterTable from "/@/components/table/DisasterTable.vue";
// //
const bootRef = ref(); const bootRef = ref();
const uploadDataRef = ref(); const uploadDataRef = ref();
const removeThis = (row) =>{
let ids = state.multipleSelection.map((item) => item.id);
//ids使
if(ids.length == 0){
ElMessage.info("Please select the data to be deleted");
return;
}
//使
ElMessageBox.confirm('Are you sure you want to delete it?', 'Prompt', {
confirmButtonText: 'Yes',
cancelButtonText: 'No',
type: 'warning',
}).then(() => {
//
removeList(ids,(state.searchName=='1'?"News":null)).then((res) => {
ElMessage.success("Delete successfully");
getTableData();
});
}).catch(() => { ElMessage.error("Delete failed");});
}
const state = reactive({ const state = reactive({
dialogVisible: false, dialogVisible: false,
@ -254,7 +279,7 @@ const getTableData = () => {
}; };
// //
const startBot = (row: any) => { const startBot = (row) => {
bootRef.value.openDialog(row); bootRef.value.openDialog(row);
}; };

View File

@ -60,11 +60,20 @@
<el-button class="ml10" type="success" style="margin-top:15px" @click="OpenuploadDataRef()"> <el-button class="ml10" type="success" style="margin-top:15px" @click="OpenuploadDataRef()">
Upload Img</el-button> Upload Img</el-button>
</el-col> </el-col>
<el-col :span="3" v-auth-role="'admin'" style="margin-left:25px">
<el-button size="default" type="danger" v-auth-role="'admin'" class="upload-demo" style="margin-top: 15px; height: 40px;" @click="removeThis">
<el-icon>
<ele-Delete />
</el-icon>
Delete
</el-button>
</el-col>
</el-row> </el-row>
</div> </div>
<!-- id卫星类型生产日期产品谱段产品分辨率云覆盖量景中心经纬度元数据下载链接缩略图 支撑单位 --> <!-- id卫星类型生产日期产品谱段产品分辨率云覆盖量景中心经纬度元数据下载链接缩略图 支撑单位 -->
<el-table :data="state.requestData" style="width: 1000Px;"> <el-table :data="state.requestData" style="width: 1000Px;" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" v-auth-role="'admin'" />
<el-table-column type="index" label="Index" align="center" width="80"></el-table-column> <el-table-column type="index" label="Index" align="center" width="80"></el-table-column>
<el-table-column prop="thumbnailLink" label="thumbnail" width="180" show-overflow-tooltip> <el-table-column prop="thumbnailLink" label="thumbnail" width="180" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
@ -117,13 +126,37 @@
<script setup> <script setup>
import { ref, reactive, onMounted } from 'vue'; import { ref, reactive, onMounted } from 'vue';
import { getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData, importTemplate } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js"; import { getRemoteSensingSourceDataByCondition, getPagesRemoteSensingSourceData, importTemplate ,removeList } from "/@/api/remoteSensingSourceData/remoteSensingSourceData.js";
import { getDisasterPage } from '/@/api/data/otherData.js' import { getDisasterPage } from '/@/api/data/otherData.js'
import disasterTable from "/@/components/table/DisasterTable.vue"; import disasterTable from "/@/components/table/DisasterTable.vue";
import approvalData from "./approvalData.vue"; import approvalData from "./approvalData.vue";
import addAddress from "./addAddress.vue"; import addAddress from "./addAddress.vue";
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import uploadData from "./uploadData.vue"; import uploadData from "./uploadData.vue";
//
const handleSelectionChange = (val) => {
state.multipleSelection = val;
};
const removeThis = ()=>{
let ids = state.multipleSelection.map((item) => item.id);
//ids使
if(ids.length == 0){
ElMessage.info("Please select the data to be deleted");
return;
}
//使
ElMessageBox.confirm('Are you sure you want to delete it?', 'Prompt', {
confirmButtonText: 'Yes',
cancelButtonText: 'No',
type: 'warning',
}).then(() => {
//
removeList(ids,(state.searchName=='1'?"News":null)).then((res) => {
ElMessage.success("Delete successfully");
getTableData();
});
}).catch(() => { ElMessage.error("Delete failed");});
}
// import { getList as getDisasterPage } from '/@/api/disasterInfo/index'; // import { getList as getDisasterPage } from '/@/api/disasterInfo/index';
const approvalDataRef = ref(); const approvalDataRef = ref();

View File

@ -34,6 +34,7 @@
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip> <el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-button size="small" text type="primary" @click="auditData(scope.row)">Audit</el-button> <el-button size="small" text type="primary" @click="auditData(scope.row)">Audit</el-button>
<el-button size="small" v-auth-role="'admin'" text type="danger" @click="removeThis(scope.row)">Delete</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -54,18 +55,37 @@
<script lang="ts" setup name="systemRole"> <script lang="ts" setup name="systemRole">
import en from 'element-plus/dist/locale/en.mjs' import en from 'element-plus/dist/locale/en.mjs'
import type { TabsPaneContext } from 'element-plus'; import type { TabsPaneContext } from 'element-plus';
import { getDataUploadPage, getDisasterPage } from '/@/api/response/dataUpload.js' import { getDataUploadPage, getDisasterPage, remove } from '/@/api/response/dataUpload.js'
const activeName = ref('first'); const activeName = ref('first');
const handleClick = (tab: TabsPaneContext, event: Event) => { const handleClick = (tab: TabsPaneContext, event: Event) => {
console.log(tab, event); console.log(tab, event);
}; };
const removeThis =(row) =>{
let arr = [];
arr.push(row.id);
//使
ElMessageBox.confirm('Are you sure you want to delete this data?', 'Warning', {
confirmButtonText: 'Confirm',
cancelButtonText: 'Cancel',
type: 'warning'
}).then(() => {
remove(arr).then((res) => {
ElMessage.success("Delete successfully");
getTableData();
})
}).catch(() => {
ElMessage.info("Cancel deletion");
});
}
// //
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue'; import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import Audit from './component/audit.vue'; import Audit from './component/audit.vue';
import disasterTable from "/@/components/table/DisasterTable.vue"; import disasterTable from "/@/components/table/DisasterTable.vue";
// //
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue')); const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
const auditRef = ref(); const auditRef = ref();

View File

@ -59,6 +59,11 @@
{{ dateFormat(scope.row.disasterTime) }} {{ dateFormat(scope.row.disasterTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="200" prop="Operate" label="Operate" show-overflow-tooltip sortable v-auth-role="'admin'">
<template #default="scope">
<el-button size="small" text type="danger" @click="remove(scope.row)">Delete</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
:pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background
@ -70,25 +75,25 @@
<el-tab-pane label="Approved" name="second"> <el-tab-pane label="Approved" name="second">
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%"> <el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
<el-table-column prop="username" label="User name" show-overflow-tooltip sortable></el-table-column> <el-table-column prop="username" label="User name" show-overflow-tooltip sortable width="150"></el-table-column>
<el-table-column prop="organization" label="Organization" show-overflow-tooltip sortable></el-table-column> <el-table-column prop="organization" label="Organization" show-overflow-tooltip sortable width="160"></el-table-column>
<el-table-column prop="email" label="Email" show-overflow-tooltip sortable></el-table-column> <el-table-column prop="email" label="Email" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip sortable> <el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip sortable width="160">
<!-- 在disasterType中获取dictKey 对应的dictValue --> <!-- 在disasterType中获取dictKey 对应的dictValue -->
<template #default="scope"> <template #default="scope">
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag> <el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip <el-table-column prop="disasterKeyword" label="Disaster keyword" width="190" show-overflow-tooltip
sortable></el-table-column> sortable></el-table-column>
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip sortable> <el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip sortable width="150">
<template #default="scope"> <template #default="scope">
<!-- 格式化去除时分秒 --> <!-- 格式化去除时分秒 -->
{{ dateFormat(scope.row.disasterTime) }} {{ dateFormat(scope.row.disasterTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="chiefName" label="Answer" show-overflow-tooltip sortable></el-table-column> <el-table-column prop="chiefName" label="Answer" show-overflow-tooltip sortable></el-table-column>
<el-table-column prop="reviewTime" label="reviewTime" show-overflow-tooltip sortable /> <el-table-column prop="reviewTime" label="reviewTime" show-overflow-tooltip sortable width="140"/>
<el-table-column width="170" prop="respondStatus" label="Response status" show-overflow-tooltip sortable> <el-table-column width="170" prop="respondStatus" label="Response status" show-overflow-tooltip sortable>
<template #default="scope"> <template #default="scope">
<el-tag type="info" v-if="scope.row.respondStatus === 2">Approved</el-tag> <el-tag type="info" v-if="scope.row.respondStatus === 2">Approved</el-tag>
@ -96,10 +101,11 @@
<el-tag type="success" v-if="scope.row.respondStatus === 3">Complete response</el-tag> <el-tag type="success" v-if="scope.row.respondStatus === 3">Complete response</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="200" prop="Operate" label="Operate" show-overflow-tooltip sortable> <el-table-column width="240" prop="Operate" label="Operate" show-overflow-tooltip sortable>
<template #default="scope"> <template #default="scope">
<el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocation</el-button> <el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocation</el-button>
<el-button size="small" text type="danger" @click="responseEnded(scope.row)">Response ended</el-button> <el-button size="small" text type="danger" @click="responseEnded(scope.row)">Response ended</el-button>
<el-button size="small" text type="danger" @click="remove(scope.row)" v-auth-role="'admin'">Delete</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -135,6 +141,11 @@
{{ dateFormat(scope.row.respondedTime) }} {{ dateFormat(scope.row.respondedTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="200" prop="Operate" label="Operate" show-overflow-tooltip sortable>
<template #default="scope" v-auth-role="'admin'">
<el-button size="small" text type="danger" @click="remove(scope.row)">Delete</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
:pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background :pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background
@ -228,7 +239,7 @@
import en from 'element-plus/dist/locale/en.mjs' import en from 'element-plus/dist/locale/en.mjs'
import { reactive, onMounted, ref, nextTick, watchEffect, defineAsyncComponent, h } from 'vue'; import { reactive, onMounted, ref, nextTick, watchEffect, defineAsyncComponent, h } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import { getList, review, responseEndedDisasterInfo } from '/@/api/disasterInfo/index'; import { getList, review, responseEndedDisasterInfo,deleteByIds } from '/@/api/disasterInfo/index';
import { getDictionary, getList as getListNew } from '/@/api/system/dictbiz'; import { getDictionary, getList as getListNew } from '/@/api/system/dictbiz';
import { useVariableStore } from '/@/stores/index.ts' import { useVariableStore } from '/@/stores/index.ts'
// //
@ -247,7 +258,24 @@ const variableStore = useVariableStore();
const mapRef = ref(); const mapRef = ref();
const activeName = ref('first'); const activeName = ref('first');
const select = ref(); const select = ref();
const remove =(row) =>{
let arr = [];
arr.push(row.disasterId);
//使
ElMessageBox.confirm('Are you sure you want to delete it?', 'Prompt', {
confirmButtonText: 'Yes',
cancelButtonText: 'No',
type: 'warning',
})
.then(() => {
deleteByIds(arr).then((da) => {
getTableData();
ElMessage.success('success');
})
})
.catch(() => { });
}
const handleClick = (tab, event) => { const handleClick = (tab, event) => {
state.selectName = tab.props.name; state.selectName = tab.props.name;
getTableData(); getTableData();