This commit is contained in:
刘旋 2023-04-23 17:36:58 +08:00
commit 73493ba319
18 changed files with 439 additions and 463 deletions

12
package-lock.json generated
View File

@ -342,6 +342,11 @@
"fastq": "^1.6.0" "fastq": "^1.6.0"
} }
}, },
"@popperjs/core": {
"version": "npm:@sxzz/popperjs-es@2.11.7",
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
},
"@rollup/pluginutils": { "@rollup/pluginutils": {
"version": "4.2.1", "version": "4.2.1",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
@ -2326,13 +2331,6 @@
"lodash-unified": "^1.0.2", "lodash-unified": "^1.0.2",
"memoize-one": "^6.0.0", "memoize-one": "^6.0.0",
"normalize-wheel-es": "^1.2.0" "normalize-wheel-es": "^1.2.0"
},
"dependencies": {
"@popperjs/core": {
"version": "npm:@sxzz/popperjs-es@2.11.7",
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
}
} }
}, },
"esbuild": { "esbuild": {

View File

@ -4,7 +4,7 @@ import qs from 'qs';
import { Session } from '/@/utils/storage'; import { Session } from '/@/utils/storage';
// export const moduleName = 'zqq-biz-vordm'; // export const moduleName = 'zqq-biz-vordm';
export const moduleName = 'glj-biz-vordm'; export const moduleName = 'biz-vordm';
export const crawlModule = 'vordm-crawl'; export const crawlModule = 'vordm-crawl';
// 配置新建一个 axios 实例 // 配置新建一个 axios 实例
const service = axios.create({ const service = axios.create({

View File

@ -380,7 +380,7 @@ onMounted(() => {
} }
} }
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -278,7 +278,7 @@ onMounted(() => {
} }
} }
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -291,8 +291,8 @@ onMounted(() => {
</script> </script>
<style> <style>
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
.demo-tabs>.el-tabs__content { .demo-tabs>.el-tabs__content {

View File

@ -641,7 +641,7 @@ const searchDisasterDate = () => {
padding-left: 1%; padding-left: 1%;
} }
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -49,7 +49,7 @@
@selection-change="handleSelectionChange" style="width: 100%"> @selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55" />
<el-table-column type="index" label="ID" width="50" /> <el-table-column type="index" label="ID" width="50" />
<el-table-column prop="time" label="time" show-overflow-tooltip></el-table-column> <el-table-column prop="date" label="date" show-overflow-tooltip></el-table-column>
<el-table-column prop="frequency" label="frequency" show-overflow-tooltip></el-table-column> <el-table-column prop="frequency" label="frequency" show-overflow-tooltip></el-table-column>
<el-table-column prop="word" label="word" show-overflow-tooltip></el-table-column> <el-table-column prop="word" label="word" show-overflow-tooltip></el-table-column>
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip> <el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
@ -367,7 +367,7 @@ onMounted(() => {
font-weight: 600; font-weight: 600;
} }
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -1,11 +1,11 @@
<template> <template>
<div class="system-user-container" style="width:calc(100% - 10px) !important ;"> <div class="system-user-container" style="width:calc(100% - 10px) !important ;">
<el-config-provider :locale="en"> <el-config-provider :locale="en">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover"> <el-card shadow="hover">
<div class="system-user-search mb15"> <div class="system-user-search mb15">
<el-form> <el-form>
<el-row> <el-row>
<el-col :span="4"> <el-col :span="4">
<el-form-item label="User name"><el-input size="default" style="max-width: 180px" <el-form-item label="User name"><el-input size="default" style="max-width: 180px"
@ -15,8 +15,8 @@
</el-col> </el-col>
<!-- <el-col :span="4"> <!-- <el-col :span="4">
<el-form-item label="checked" style="margin-left: 10px;"> <el-form-item label="checked" style="margin-left: 10px;">
<el-select size="default" v-model="state.query.status" clearable style="max-width: 180px" <el-select size="default" v-model="state.query.status" clearable
placeholder="Replied"> style="max-width: 180px" placeholder="Replied">
<el-option label="UnReplied" :value="0"></el-option> <el-option label="UnReplied" :value="0"></el-option>
<el-option label="Replied" :value="1"></el-option> <el-option label="Replied" :value="1"></el-option>
<el-option label="Observed" :value="2"></el-option> <el-option label="Observed" :value="2"></el-option>
@ -93,9 +93,9 @@
</template> </template>
<script setup name="contact"> <script setup name="contact">
import { getList, remove,emailSend } from '/@/api/contact/index' import { getList, remove, emailSend } from '/@/api/contact/index'
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import { ref, reactive, onMounted, nextTick,toRaw } from 'vue'; import { ref, reactive, onMounted, nextTick, toRaw } from 'vue';
import en from 'element-plus/dist/locale/en.mjs' import en from 'element-plus/dist/locale/en.mjs'
import { QuillEditor } from '@vueup/vue-quill' import { QuillEditor } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css' import '@vueup/vue-quill/dist/vue-quill.snow.css'
@ -116,7 +116,7 @@ const state = reactive({
}, },
selected: [], selected: [],
dialogVisible: false, dialogVisible: false,
options:{ options: {
modules: { modules: {
toolbar: [ toolbar: [
['bold', 'italic', 'underline', 'strike'], ['bold', 'italic', 'underline', 'strike'],
@ -133,20 +133,20 @@ const state = reactive({
}, },
placeholder: '请输入内容...' placeholder: '请输入内容...'
}, },
email:{ email: {
subject:'Thank You for Your Support', subject: 'Thank You for Your Support',
text:'Dear Rising Sun,'+ text: 'Dear Rising Sun,' +
'I would like to express my heartfelt gratitude to you for your kind support and assistance during my recent project. I appreciate the time and effort you have dedicated to helping me with technical and news-related issues.'+ 'I would like to express my heartfelt gratitude to you for your kind support and assistance during my recent project. I appreciate the time and effort you have dedicated to helping me with technical and news-related issues.' +
'It has been a pleasure working with such a knowledgeable and professional individual like you. Your expertise and guidance have proven to be invaluable to me, and I am truly grateful for your assistance throughout the process.'+ 'It has been a pleasure working with such a knowledgeable and professional individual like you. Your expertise and guidance have proven to be invaluable to me, and I am truly grateful for your assistance throughout the process.' +
'Once again, thank you so much for your help and cooperation. I look forward to collaborating with you again in the future.'+ 'Once again, thank you so much for your help and cooperation. I look forward to collaborating with you again in the future.' +
' Best regards,'+ ' Best regards,' +
' yyhouc' ' yyhouc'
} , },
// //
}); });
const setValue = () => { const setValue = () => {
const text = toRaw(myQuillEditor.value).getHTML() const text = toRaw(myQuillEditor.value).getHTML()
console.log(text) console.log(text)
} }
// //
const initTableData = () => { const initTableData = () => {
@ -174,7 +174,7 @@ const onOpenEdit = (row) => {
}; };
const send = () => { const send = () => {
state.email.email="792163605@qq.com" state.email.email = "792163605@qq.com"
emailSend(state.email).then(res => { emailSend(state.email).then(res => {
ElMessage.success('发送成功'); ElMessage.success('发送成功');
state.dialogVisible = false; state.dialogVisible = false;
@ -218,9 +218,8 @@ onMounted(() => {
}); });
</script> </script>
<style> <style>
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -224,7 +224,7 @@ onMounted(() => {
getTableData(); getTableData();
}); });
</script> </script>
<style> <style scoped lang="scss">
.demo-tabs>.el-tabs__content { .demo-tabs>.el-tabs__content {
padding: 32px; padding: 32px;
color: #6b778c; color: #6b778c;
@ -242,7 +242,7 @@ onMounted(() => {
} }
} }
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -1,7 +1,6 @@
<template> <template>
<div class="system-user-container" style="width:calc(100% - 10px) !important ;">
<div class="system-user-container" style="width:calc(100% - 10px) !important ;"> <el-config-provider :locale="en">
<el-config-provider :locale="en">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="24"> <el-col :span="24">
<el-card shadow="hover"> <el-card shadow="hover">
@ -54,8 +53,8 @@
<el-table-column prop="reviewTime" label="Review Time"></el-table-column> <el-table-column prop="reviewTime" label="Review Time"></el-table-column>
<el-table-column label="Operate" width="140"> <el-table-column label="Operate" width="140">
<template #default="scope"> <template #default="scope">
<el-button :style='scope.row.reviewTime?"display:none;":"" ' size="small" text type="primary" <el-button :style='scope.row.reviewTime ? "display:none;" : ""' size="small" text
@click="onOpenEdit(scope.row)">Review</el-button> type="primary" @click="onOpenEdit(scope.row)">Review</el-button>
<el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary" <el-button :disabled="scope.row.userName === 'admin'" size="small" text type="primary"
@click="onRowDel(scope.row)">Delete</el-button> @click="onRowDel(scope.row)">Delete</el-button>
</template> </template>
@ -64,20 +63,19 @@
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange"
class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]" class="mt15" :pager-count="3" :page-sizes="[10, 20, 30]"
v-model:current-page="state.tableData.param.pageNum" background v-model:current-page="state.tableData.param.pageNum" background
v-model:page-size="state.tableData.param.pageSize" v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
layout="total, sizes, prev, pager, next" :total="state.tableData.total"> :total="state.tableData.total">
</el-pagination> </el-pagination>
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
</el-config-provider> </el-config-provider>
</div> </div>
</template> </template>
<script setup name="systemUser"> <script setup name="systemUser">
import en from 'element-plus/dist/locale/en.mjs' import en from 'element-plus/dist/locale/en.mjs'
import { getList, remove ,review } from '/@/api/tool/index' import { getList, remove, review } from '/@/api/tool/index'
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import { reactive, ref, onMounted, nextTick } from 'vue'; import { reactive, ref, onMounted, nextTick } from 'vue';
const AddRef = ref(); const AddRef = ref();
@ -126,13 +124,13 @@ const onOpenEdit = (row) => {
cancelButtonText: 'cancel', cancelButtonText: 'cancel',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
review({id:row.id}).then(res => { review({ id: row.id }).then(res => {
ElMessage.success('success'); ElMessage.success('success');
initTableData(); initTableData();
})
}) })
}) .catch(() => { });
.catch(() => { });
}; };
// //
@ -172,9 +170,8 @@ onMounted(() => {
}); });
</script> </script>
<style> <style>
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -5,27 +5,28 @@
<div class="system-user-search mb15"> <div class="system-user-search mb15">
<el-input size="default" placeholder="Name" style="max-width: 180px" <el-input size="default" placeholder="Name" style="max-width: 180px"
v-model="state.tableData.query.name"> </el-input> v-model="state.tableData.query.name"> </el-input>
<el-button size="default" type="primary" class="ml10" @click="getTableData" > <el-button size="default" type="primary" class="ml10" @click="getTableData">
<el-icon> <el-icon>
<ele-Search /> <ele-Search />
</el-icon> </el-icon>
search search
</el-button> </el-button>
</div> </div>
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%" @selection-change = "selectionChange"> <el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%"
@selection-change="selectionChange">
<el-table-column type="selection" width="60" @select="selectRow" /> <el-table-column type="selection" width="60" @select="selectRow" />
<el-table-column prop="name" label="Name" show-overflow-tooltip></el-table-column> <el-table-column prop="name" label="Name" show-overflow-tooltip></el-table-column>
<el-table-column prop="email" label="E-mail" show-overflow-tooltip></el-table-column> <el-table-column prop="email" label="E-mail" show-overflow-tooltip></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="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" :pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum"
background v-model:page-size="state.tableData.param.pageSize" background v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
layout="total, sizes, prev, pager, next" :total="state.tableData.total"> :total="state.tableData.total">
</el-pagination> </el-pagination>
</el-card> </el-card>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="state.isShowDialog = false" >Cancel</el-button> <el-button @click="state.isShowDialog = false">Cancel</el-button>
<el-button type="success" @click="save()"> <el-button type="success" @click="save()">
Save Save
</el-button> </el-button>
@ -37,7 +38,7 @@
<script setup> <script setup>
import { ElMessage } from 'element-plus'; import { ElMessage } from 'element-plus';
import { getUserList,submit } from '/@/api/disasterInfo/index'; import { getUserList, submit } from '/@/api/disasterInfo/index';
import { ref, reactive, onMounted } from 'vue'; import { ref, reactive, onMounted } from 'vue';
const formRef = ref(); const formRef = ref();
@ -81,9 +82,9 @@ const save = async () => {
return; return;
} }
let params = { let params = {
id:state.rowData.id, id: state.rowData.id,
chiefId:state.selectData[0].id, chiefId: state.selectData[0].id,
chiefName:state.selectData[0].name, chiefName: state.selectData[0].name,
}; };
let res = await submit(params); let res = await submit(params);
emit('callback'); emit('callback');
@ -133,7 +134,7 @@ defineExpose({
</script> </script>
<style> <style>
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -37,9 +37,9 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column> <!-- <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> --> <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="status" label="角色状态" show-overflow-tooltip> <!-- <el-table-column prop="status" label="角色状态" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-tag type="success" v-if="scope.row.status">启用</el-tag> <el-tag type="success" v-if="scope.row.status">启用</el-tag>
<el-tag type="info" v-else>禁用</el-tag> <el-tag type="info" v-else>禁用</el-tag>
@ -79,77 +79,119 @@
<!-- <el-table-column prop="Affected country" label="Affected country" show-overflow-tooltip></el-table-column> --> <!-- <el-table-column prop="Affected country" label="Affected country" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="Longitude" label="Longitude" show-overflow-tooltip></el-table-column> <!-- <el-table-column prop="Longitude" label="Longitude" show-overflow-tooltip></el-table-column>
<el-table-column prop="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> --> <el-table-column prop="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip> <el-table-column prop="disasterTime"
label="Disaster time"
show-overflow-tooltip>
<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></el-table-column> <el-table-column prop="chiefName"
<!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> --> label="Answer"
<!-- <el-table-column prop="Operate" label="Operate" show-overflow-tooltip></el-table-column> --> show-overflow-tooltip></el-table-column>
<el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip> <!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
<!-- <el-table-column prop="Operate" label="Operate" show-overflow-tooltip></el-table-column> -->
<el-table-column prop="respondStatus"
label="Response status"
show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-tag type="info" v-if="scope.row.respondStatus === 2">Reviewed</el-tag> <el-tag type="info"
<el-tag type="info" v-if="scope.row.respondStatus === 1">Failed</el-tag> v-if="scope.row.respondStatus === 2">Reviewed</el-tag>
</template> <el-tag type="info"
v-if="scope.row.respondStatus === 1">Failed</el-tag>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip> <el-table-column prop="Operate"
<template #default="scope"> label="Operate"
<el-button size="small" text type="primary" @click="onAllocation(scope.row)">Allocation</el-button> show-overflow-tooltip>
</template> <template #default="scope">
</el-table-column> <el-button size="small"
</el-table> text
<el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15" type="primary"
:pager-count="5" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.current" background @click="onAllocation(scope.row)">Allocation</el-button>
v-model:page-size="state.tableData.param.size" layout="total, sizes, prev, pager, next, jumper" </template>
:total="state.tableData.total"> </el-table-column>
</el-pagination> </el-table>
</el-tab-pane> <el-pagination @size-change="onHandleSizeChange"
</el-tabs> @current-change="onHandleCurrentChange"
</div> class="mt15"
<el-dialog v-model="state.dialogVisible" title="Review" width="30%"> :pager-count="5"
<el-container style="margin-top: -2%;margin-bottom: 2%;"> :page-sizes="[10, 20, 30]"
<el-radio v-model="state.radio" label='1' @click="mapEvents('1')">Point</el-radio> v-model:current-page="state.tableData.param.current"
<el-radio v-model="state.radio" label='2' @click="mapEvents('2')">Area</el-radio> background
<el-radio v-model="state.radio" label='3' @click="mapEvents('3')">Edit</el-radio> v-model:page-size="state.tableData.param.size"
<el-button type="primary" style="margin-left: 5%;" @click="ClearSubmit">Clear</el-button> layout="total, sizes, prev, pager, next, jumper"
</el-container> :total="state.tableData.total">
<el-container style="margin-top: 2%;margin-bottom: 2%;" v-if="state.radio==='1'?true:false"> </el-pagination>
<span style="line-height: 35px;"> Latitude</span> </el-tab-pane>
<el-input placeholder="wait……" style="height:35px;margin-right: 1%;" v-model="state.dislat" readonly="readonly"> </el-input> </el-tabs>
<span style="line-height: 35px;">Longitude</span> </div>
<el-input placeholder="wait……" style="height:35px;" v-model="state.dislon" readonly="readonly"></el-input> <el-dialog v-model="state.dialogVisible"
</el-container> title="Review"
<MapPage style="height:350px ; width:100% ;margin-bottom: 10px;" ref="mapRef"></MapPage> width="30%">
<el-form-item label="Disaster Time"> <el-container style="margin-top: -2%;margin-bottom: 2%;">
<el-date-picker v-model="state.edit.disasterTime" type="date" value-format="YYYY-MM-DD" <el-radio v-model="state.radio"
placeholder="Select date and time" /> label='1'
</el-form-item> @click="mapEvents('1')">Point</el-radio>
<el-radio v-model="state.radio"
label='2'
@click="mapEvents('2')">Area</el-radio>
<el-radio v-model="state.radio"
label='3'
@click="mapEvents('3')">Edit</el-radio>
<el-button type="primary"
style="margin-left: 5%;"
@click="ClearSubmit">Clear</el-button>
</el-container>
<el-container style="margin-top: 2%;margin-bottom: 2%;"
v-if="state.radio==='1'?true:false">
<span style="line-height: 35px;"> Latitude</span>
<el-input placeholder="wait……"
style="height:35px;margin-right: 1%;"
v-model="state.dislat"
readonly="readonly"> </el-input>
<span style="line-height: 35px;">Longitude</span>
<el-input placeholder="wait……"
style="height:35px;"
v-model="state.dislon"
readonly="readonly"></el-input>
</el-container>
<MapPage style="height:350px ; width:100% ;margin-bottom: 10px;"
ref="mapRef"></MapPage>
<el-form-item label="Disaster Time">
<el-date-picker v-model="state.edit.disasterTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="Select date and time" />
</el-form-item>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="dialogVisible = false">Cancel</el-button> <el-button @click="dialogVisible = false">Cancel</el-button>
<el-button type="danger" @click="reviews(1)"> <el-button type="danger"
Not Review @click="reviews(1)">
</el-button> Not Review
<el-button type="primary" @click="reviews(2)"> </el-button>
Review <el-button type="primary"
</el-button> @click="reviews(2)">
</span> Review
</template> </el-button>
</el-dialog> </span>
<selectUser ref ="select" @callback="getTableData"></selectUser> </template>
</el-dialog>
<selectUser ref="select"
@callback="getTableData"></selectUser>
</el-config-provider> </el-config-provider>
</div> </div>
</template> </template>
<script setup name="userResponse"> <script setup name="userResponse">
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 } from 'vue'; import { reactive, onMounted, ref, nextTick, watchEffect, defineAsyncComponent } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus'; import { ElMessageBox, ElMessage } from 'element-plus';
import { getList, review } from '/@/api/disasterInfo/index'; import { getList, review } from '/@/api/disasterInfo/index';
import { getDictionary } from '/@/api/system/dictbiz'; import { getDictionary } from '/@/api/system/dictbiz';
@ -175,7 +217,7 @@ const handleClick = (tab, event) => {
getTableData(); getTableData();
}; };
const MapPage = defineAsyncComponent({ const MapPage = defineAsyncComponent({
loader:() =>import('/@/components/Map.vue'), loader: () => import('/@/components/Map.vue'),
delay: 200, delay: 200,
}) })
const onAllocation = (row) => { const onAllocation = (row) => {
@ -202,10 +244,10 @@ const state = reactive({
disasterTypeList: [], disasterTypeList: [],
selectName: 'first', selectName: 'first',
edit: {}, edit: {},
radio:null, radio: null,
dislat:'', dislat: '',
dislon:'', dislon: '',
wktPoint_Poly:undefined wktPoint_Poly: undefined
}); });
// //
const getTableData = () => { const getTableData = () => {
@ -232,36 +274,36 @@ const onOpenEditRole = (type, row) => {
state.edit = JSON.parse(JSON.stringify(row)); state.edit = JSON.parse(JSON.stringify(row));
state.dialogVisible = true; state.dialogVisible = true;
setTimeout(() => { setTimeout(() => {
state.radio = "1" state.radio = "1"
// mapRef.value.mapOperations.removeAll() // mapRef.value.mapOperations.removeAll()
// //
if(state.wktPoint_Poly){ if (state.wktPoint_Poly) {
mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly) mapRef.value.mapOperations.removeLayer(state.wktPoint_Poly)
} }
state.wktPoint_Poly= mapRef.value.mapOperations.wktParseToMap(row.geometry) state.wktPoint_Poly = mapRef.value.mapOperations.wktParseToMap(row.geometry)
// mapRef.value.mapOperations.on("click", (res)=>{ // mapRef.value.mapOperations.on("click", (res)=>{
// mapRef.value.mapOperations.clearPolygon() // mapRef.value.mapOperations.clearPolygon()
// mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly) // mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly)
// mapRef.value.mapOperations.addInteractMarker(res.latlng.lat, res.latlng.lng) // mapRef.value.mapOperations.addInteractMarker(res.latlng.lat, res.latlng.lng)
// }) // })
mapEvents('1') mapEvents('1')
},100); }, 100);
}; };
const mapEvents = (ev)=>{ const mapEvents = (ev) => {
if(ev == '1'){ if (ev == '1') {
// mapRef.value.mapOperations.clearPolygon() // mapRef.value.mapOperations.clearPolygon()
mapRef.value.mapOperations.on("click", mapClick) mapRef.value.mapOperations.on("click", mapClick)
mapRef.value.mapOperations.on("mousemove", changelatlon) mapRef.value.mapOperations.on("mousemove", changelatlon)
mapRef.value.mapOperations.clearPolygon() mapRef.value.mapOperations.clearPolygon()
}else if(ev == '2'){ } else if (ev == '2') {
mapRef.value.mapOperations.off("click",mapClick); mapRef.value.mapOperations.off("click", mapClick);
mapRef.value.mapOperations.drawPolygon() mapRef.value.mapOperations.drawPolygon()
// mapRef.value.mapOperations.drawPolygon() // mapRef.value.mapOperations.drawPolygon()
// mapRef.value.mapOperations.drawCreated() // mapRef.value.mapOperations.drawCreated()
} }
else{ else {
mapRef.value.mapOperations.Edit() mapRef.value.mapOperations.Edit()
} }
}; };
@ -269,14 +311,14 @@ const ClearSubmit = () => {
setTimeout(() => { setTimeout(() => {
mapRef.value.mapOperations.removeAll() mapRef.value.mapOperations.removeAll()
variableStore.wktdata = null variableStore.wktdata = null
variableStore.layerGroupPoint=null; variableStore.layerGroupPoint = null;
layerGroupPoly=null; layerGroupPoly = null;
}, 100) }, 100)
} }
const mapClick=(res)=>{ const mapClick = (res) => {
// mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly ) // mapRef.value.mapOperations.removeLayer( state.wktPoint_Poly )
changelatlon(res); changelatlon(res);
mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3),res.latlng.lng.toFixed(3)) mapRef.value.mapOperations.addInteractMarker(res.latlng.lat.toFixed(3), res.latlng.lng.toFixed(3))
// console.log(state.wktPoint_Poly) // console.log(state.wktPoint_Poly)
} }
const reviews = (index) => { const reviews = (index) => {
@ -310,44 +352,44 @@ const onHandleCurrentChange = (val) => {
const changelatlon = (e) => { const changelatlon = (e) => {
//e //e
state.dislat = e.latlng.lat.toFixed(3); state.dislat = e.latlng.lat.toFixed(3);
state.dislon= e.latlng.lng.toFixed(3); state.dislon = e.latlng.lng.toFixed(3);
// if (state.lon < 0) { // if (state.lon < 0) {
// state.lon = state.lon + 360; // state.lon = state.lon + 360;
// } // }
// state.lon = state.lon.toFixed(3); // state.lon = state.lon.toFixed(3);
if (state.dislat < 0) { if (state.dislat < 0) {
state.dislat = String(Math.abs(state.dislat)) + "°S" state.dislat = String(Math.abs(state.dislat)) + "°S"
} }
else { else {
state.dislat = String(state.dislat) + "°N" state.dislat = String(state.dislat) + "°N"
} }
if (state.dislon <= 180 && state.dislon >= 0) {
state.dislon = String(Math.abs(state.dislon)) + "°E"
}
else if (state.dislon > 180 && state.dislon <= 360) {
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
}
else if (state.dislon < 0) {
let n = Math.floor(state.dislon / 360)
state.dislon = (state.dislon - n * 360).toFixed(3)
if (state.dislon <= 180 && state.dislon >= 0) { if (state.dislon <= 180 && state.dislon >= 0) {
state.dislon = String(Math.abs(state.dislon)) + "°E" state.dislon = String(Math.abs(state.dislon)) + "°E"
} }
else if (state.dislon > 180 && state.dislon <= 360) { else if (state.dislon > 180 && state.dislon <= 360) {
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W" state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
} }
} else if (state.dislon < 0) {
else if (state.dislon > 360) { let n = Math.floor(state.dislon / 360)
let n = Math.floor(state.dislon / 360) state.dislon = (state.dislon - n * 360).toFixed(3)
state.dislon = (state.dislon - n * 360).toFixed(3) if (state.dislon <= 180 && state.dislon >= 0) {
if (state.dislon <= 180 && state.dislon >= 0) { state.dislon = String(Math.abs(state.dislon)) + "°E"
state.dislon = String(Math.abs(state.dislon)) + "°E" }
else if (state.dislon > 180 && state.dislon <= 360) {
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
}
} }
else if (state.dislon > 180 && state.dislon <= 360) { else if (state.dislon > 360) {
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W" let n = Math.floor(state.dislon / 360)
state.dislon = (state.dislon - n * 360).toFixed(3)
if (state.dislon <= 180 && state.dislon >= 0) {
state.dislon = String(Math.abs(state.dislon)) + "°E"
}
else if (state.dislon > 180 && state.dislon <= 360) {
state.dislon = String((360 - state.dislon).toFixed(3)) + "°W"
}
} }
}
} }
// //
@ -363,21 +405,27 @@ const getValue = (key) => {
return state.disasterTypeList.find((item) => item.dictKey === key)?.dictValue; return state.disasterTypeList.find((item) => item.dictKey === key)?.dictValue;
}; };
</script> </script>
<style> <style lang="scss">
.demo-tabs>.el-tabs__content { .demo-tabs > .el-tabs__content {
padding: 0px; padding: 0px;
color: #6b778c; color: #6b778c;
font-size: 32px; font-size: 32px;
font-weight: 600; font-weight: 600;
} }
.system-role-container { .system-role-container {
.system-role-padding { .system-role-padding {
padding: 15px; padding: 15px;
.el-table { .el-table {
flex: 1; flex: 1;
} }
} }
}
.mt15 {
display: flex;
justify-content: end;
float: right;
margin-bottom: 15px;
} }
</style> </style>

View File

@ -2,89 +2,50 @@
<div class="system-role-container layout-padding"> <div class="system-role-container layout-padding">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view">
<div class="system-user-search mb15"> <div class="system-user-search mb15">
<el-input v-model="state.tableData.param.search" <el-input v-model="state.tableData.param.search" size="default" placeholder="请输入角色名称" style="max-width: 180px">
size="default" </el-input>
placeholder="请输入角色名称" <el-button size="default" type="primary" class="ml10">
style="max-width: 180px"> </el-input>
<el-button size="default"
type="primary"
class="ml10">
<el-icon> <el-icon>
<ele-Search /> <ele-Search />
</el-icon> </el-icon>
查询 查询
</el-button> </el-button>
<el-button size="default" <el-button size="default" type="success" class="ml10" @click="onOpenAddRole('add')">
type="success"
class="ml10"
@click="onOpenAddRole('add')">
<el-icon> <el-icon>
<ele-FolderAdd /> <ele-FolderAdd />
</el-icon> </el-icon>
新增角色 新增角色
</el-button> </el-button>
</div> </div>
<el-table :data="state.tableData.data" <el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
v-loading="state.tableData.loading" <el-table-column type="index" label="序号" width="60" />
style="width: 100%"> <el-table-column prop="roleName" label="角色名称" show-overflow-tooltip></el-table-column>
<el-table-column type="index" <el-table-column prop="roleSign" label="角色标识" show-overflow-tooltip></el-table-column>
label="序号" <el-table-column prop="sort" label="排序" show-overflow-tooltip></el-table-column>
width="60" /> <el-table-column prop="status" label="角色状态" show-overflow-tooltip>
<el-table-column prop="roleName"
label="角色名称"
show-overflow-tooltip></el-table-column>
<el-table-column prop="roleSign"
label="角色标识"
show-overflow-tooltip></el-table-column>
<el-table-column prop="sort"
label="排序"
show-overflow-tooltip></el-table-column>
<el-table-column prop="status"
label="角色状态"
show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-tag type="success" <el-tag type="success" v-if="scope.row.status">启用</el-tag>
v-if="scope.row.status">启用</el-tag> <el-tag type="info" v-else>禁用</el-tag>
<el-tag type="info"
v-else>禁用</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="describe" <el-table-column prop="describe" label="角色描述" show-overflow-tooltip></el-table-column>
label="角色描述" <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column>
show-overflow-tooltip></el-table-column> <el-table-column label="操作" width="100">
<el-table-column prop="createTime"
label="创建时间"
show-overflow-tooltip></el-table-column>
<el-table-column label="操作"
width="100">
<template #default="scope"> <template #default="scope">
<el-button :disabled="scope.row.roleName === '超级管理员'" <el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary"
size="small" @click="onOpenEditRole('edit', scope.row)">修改</el-button>
text <el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary"
type="primary" @click="onRowDel(scope.row)">删除</el-button>
@click="onOpenEditRole('edit', scope.row)">修改</el-button>
<el-button :disabled="scope.row.roleName === '超级管理员'"
size="small"
text
type="primary"
@click="onRowDel(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination @size-change="onHandleSizeChange" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
@current-change="onHandleCurrentChange" :pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
class="mt15" v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
:pager-count="3" :total="state.tableData.total">
:page-sizes="[10, 20, 30]"
v-model:current-page="state.tableData.param.pageNum"
background
v-model:page-size="state.tableData.param.pageSize"
layout="total, sizes, prev, pager, next"
:total="state.tableData.total">
</el-pagination> </el-pagination>
</div> </div>
<RoleDialog ref="roleDialogRef" <RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
@refresh="getTableData()" />
</div> </div>
</template> </template>
@ -168,15 +129,17 @@ onMounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
.system-role-container { .system-role-container {
.system-role-padding { .system-role-padding {
padding: 15px; padding: 15px;
.el-table {
flex: 1; .el-table {
} flex: 1;
} }
}
} }
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -149,7 +149,7 @@ onMounted(() => {
} }
} }
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -2,83 +2,63 @@
<div class="system-role-container layout-padding"> <div class="system-role-container layout-padding">
<div class="system-role-padding layout-padding-auto layout-padding-view"> <div class="system-role-padding layout-padding-auto layout-padding-view">
<el-config-provider :locale="en"> <el-config-provider :locale="en">
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;"> <div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
<el-input size="default" placeholder="please enter manager name" style="max-width: 200px" v-model="state.searchName" <el-input size="default" placeholder="please enter manager name" style="max-width: 200px"
clearable></el-input> v-model="state.searchName" clearable></el-input>
<el-button size="default" type="primary" class="ml10" @click="getTableData"> <el-select v-model="state.status" placeholder="please select data type" style="max-width: 200px"
<el-icon> size="default" clearable>
<ele-Search/> <el-option value= "0" label="Unclaimed"></el-option>
</el-icon> <el-option value= "1" label="Claimed"></el-option>
search </el-select>
</el-button> <el-button size="default" type="primary" class="ml10" @click="getTableData">
<el-button size="default" type="primary" class="ml10" @click="batchAudit"> <el-icon>
<el-icon> <ele-Search />
<ele-EditPen/> </el-icon>
</el-icon> search
batch audit </el-button>
</el-button> <el-button size="default" type="primary" class="ml10" @click="batchAudit">
</div> <el-icon>
<el-table :data="state.tableData.data" <ele-EditPen />
v-loading="state.tableData.loading" </el-icon>
@selection-change="handleSelectionChange" batch audit
style="width: 100%"> </el-button>
<el-table-column type="selection" width="55" /> </div>
<el-table-column type="index" <el-table :data="state.tableData.data" v-loading="state.tableData.loading"
label="ID" @selection-change="handleSelectionChange" style="width: 100%">
width="50" /> <el-table-column type="selection" width="55" />
<el-table-column prop="disasterType" <el-table-column type="index" label="ID" width="50" />
label="DisasterType" <el-table-column prop="disasterType" label="DisasterType" show-overflow-tooltip></el-table-column>
show-overflow-tooltip></el-table-column> <el-table-column prop="disasterCountry" label="DisasterCountry" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterCountry" <el-table-column prop="disasterKeyword" label="DisasterKeyword" show-overflow-tooltip></el-table-column>
label="DisasterCountry" <el-table-column prop="managerName" label="ManagerName" show-overflow-tooltip></el-table-column>
show-overflow-tooltip></el-table-column> <el-table-column prop="sponsorOrganization" label="SponsorOrganization" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterKeyword" <el-table-column prop="researchField" label="ResearchField" show-overflow-tooltip></el-table-column>
label="DisasterKeyword" <el-table-column prop="occupation" label="occupation" show-overflow-tooltip></el-table-column>
show-overflow-tooltip></el-table-column> <el-table-column prop="applyTime" label="applyTime" show-overflow-tooltip></el-table-column>
<el-table-column prop="managerName" <el-table-column v-if="state.status == '1'" prop="reviewTime" label="reviewTime" show-overflow-tooltip></el-table-column>
label="ManagerName" <el-table-column v-if="state.status == '0'" prop="Operate" label="Operate" show-overflow-tooltip>
show-overflow-tooltip></el-table-column> <template #default="scope">
<el-table-column prop="sponsorOrganization" <!-- <el-button link type="primary" size="small" @click="handleClick">Detail</el-button>-->
label="SponsorOrganization" <el-button link type="primary" size="small" @click="auditManager(scope.row)">Audit</el-button>
show-overflow-tooltip></el-table-column> </template>
<el-table-column prop="researchField" </el-table-column>
label="ResearchField" </el-table>
show-overflow-tooltip></el-table-column> <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
<el-table-column prop="occupation" :pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
label="occupation" v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
show-overflow-tooltip></el-table-column> :total="state.tableData.total">
<el-table-column prop="Operate" </el-pagination>
label="Operate"
show-overflow-tooltip>
<template #default="scope">
<!-- <el-button link type="primary" size="small" @click="handleClick">Detail</el-button>-->
<el-button link type="primary" size="small" @click="auditManager(scope.row)">Audit</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination @size-change="onHandleSizeChange"
@current-change="onHandleCurrentChange"
class="mt15"
:pager-count="3"
:page-sizes="[10, 20, 30]"
v-model:current-page="state.tableData.param.pageNum"
background
v-model:page-size="state.tableData.param.pageSize"
layout="total, sizes, prev, pager, next"
:total="state.tableData.total">
</el-pagination>
</el-config-provider> </el-config-provider>
</div> </div>
<RoleDialog ref="roleDialogRef" <RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
@refresh="getTableData()" /> <Audit ref="auditRef" @callback="getTableData" />
<Audit ref="auditRef" @callback="getTableData"/>
</div> </div>
</template> </template>
<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 {getAdminManagerPage,auditData} from '/@/api/response/adminManager.js'; import { getAdminManagerPage, auditData } from '/@/api/response/adminManager.js';
import Audit from './component/audit.vue'; import Audit from './component/audit.vue';
const activeName = ref('first'); const activeName = ref('first');
const auditRef = ref(); const auditRef = ref();
@ -95,8 +75,9 @@ const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialo
// //
const roleDialogRef = ref(); const roleDialogRef = ref();
const state = reactive({ const state = reactive({
multipleSelection:[], status:"0",
searchName:'', multipleSelection: [],
searchName: '',
tableData: { tableData: {
data: [], data: [],
total: 0, total: 0,
@ -113,7 +94,7 @@ const handleSelectionChange = (val) => {
} }
// //
const auditManager = (row) => { const auditManager = (row) => {
auditRef.value.openDialog([{...row}]); auditRef.value.openDialog([{ ...row }]);
/*ElMessageBox.confirm(`This operation will audit the disaster data${row.disasterType}Whether to continue?`, 'tip', { /*ElMessageBox.confirm(`This operation will audit the disaster data${row.disasterType}Whether to continue?`, 'tip', {
confirmButtonText: 'confirm', confirmButtonText: 'confirm',
cancelButtonText: 'cancel', cancelButtonText: 'cancel',
@ -130,7 +111,7 @@ const auditManager = (row) => {
// //
const getTableData = () => { const getTableData = () => {
state.tableData.loading = true; state.tableData.loading = true;
getAdminManagerPage(state.tableData.param.pageNum,state.tableData.param.pageSize,{"managerName":state.searchName}).then(res=>{ getAdminManagerPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { "managerName": state.searchName,"status": state.status}).then(res => {
state.tableData.data = res.records; state.tableData.data = res.records;
state.tableData.total = res.total; state.tableData.total = res.total;
}) })
@ -149,7 +130,7 @@ const onOpenEditRole = (type, row) => {
}; };
// //
const batchAudit = () => { const batchAudit = () => {
if(state.multipleSelection.length == 0){ if (state.multipleSelection.length == 0) {
ElMessage.warning("Select the data to be operated first"); ElMessage.warning("Select the data to be operated first");
return false; return false;
} }
@ -162,13 +143,13 @@ const deleteUser = (row) => {
cancelButtonText: 'cancel', cancelButtonText: 'cancel',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
/* remove(row.id).then(res=>{ /* remove(row.id).then(res=>{
getTableData(); getTableData();
ElMessage.success('Deleted successfully'); ElMessage.success('Deleted successfully');
})*/ })*/
}) })
.catch(() => {}); .catch(() => { });
}; };
// //
const onHandleSizeChange = (val) => { const onHandleSizeChange = (val) => {
@ -185,8 +166,13 @@ onMounted(() => {
getTableData(); getTableData();
}); });
</script> </script>
<style> <style scoped lang="scss">
.demo-tabs > .el-tabs__content { .mt15 {
display: flex;
justify-content: end;
}
.demo-tabs>.el-tabs__content {
padding: 32px; padding: 32px;
color: #6b778c; color: #6b778c;
font-size: 32px; font-size: 32px;
@ -194,15 +180,12 @@ onMounted(() => {
} }
.system-role-container { .system-role-container {
.system-role-padding { .system-role-padding {
padding: 15px; padding: 15px;
.el-table {
flex: 1; .el-table {
} flex: 1;
} }
} }
.mt15 {
float: right;
margin-bottom: 15px;
} }
</style> </style>

View File

@ -126,7 +126,7 @@ defineExpose({
<style scoped> <style scoped>
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -1,75 +1,62 @@
<template> <template>
<el-config-provider :locale="en"> <el-config-provider :locale="en">
<el-drawer <el-drawer v-model="state.table" title="Management Disaster" direction="rtl" size="50%">
v-model="state.table" <div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
title="Management Disaster" <el-input size="default" placeholder="please enter disaster type" style="max-width: 190px"
direction="rtl" v-model="state.searchName" clearable></el-input>
size="50%" <el-button size="default" type="primary" class="ml10" @click="getTableData">
> <el-icon>
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;"> <ele-Search />
<el-input size="default" placeholder="please enter disaster type" style="max-width: 190px" v-model="state.searchName" </el-icon>
clearable></el-input> search
<el-button size="default" type="primary" class="ml10" @click="getTableData"> </el-button>
<el-icon> <el-button size="default" type="success" class="ml10" @click="addDisaster">
<ele-Search/> <el-icon>
</el-icon> <ele-FolderAdd />
search </el-icon>
</el-button> add
<el-button size="default" type="success" class="ml10" @click="addDisaster"> </el-button>
<el-icon> <el-button size="default" type="danger" class="ml10" @click="batchDelete">
<ele-FolderAdd/> <el-icon>
</el-icon> <ele-Delete />
add </el-icon>
</el-button> batch delete
<el-button size="default" type="danger" class="ml10" @click="batchDelete"> </el-button>
<el-icon> </div>
<ele-Delete/> <el-table :data="state.tableData.data" @selection-change="handleSelectionChange">
</el-icon> <el-table-column type="selection" width="55" />
batch delete <el-table-column property="dictValue" label="DisasterType" width="150" />
</el-button> <el-table-column property="disasterCountry" label="DisasterCountry" width="200" />
</div> <el-table-column property="disasterTime" label="DisasterTime" />
<el-table :data="state.tableData.data" @selection-change="handleSelectionChange"> <el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
<el-table-column type="selection" width="55" /> <template #default="scope">
<el-table-column property="dictValue" label="DisasterType" width="150" /> <el-button link type="primary" size="small" @click="deleteDisaster(scope.row)">Delete</el-button>
<el-table-column property="disasterCountry" label="DisasterCountry" width="200" /> </template>
<el-table-column property="disasterTime" label="DisasterTime" /> </el-table-column>
<el-table-column prop="Operate" </el-table>
label="Operate" <el-pagination @size-change="onHandleSizeChange" @current-change="onHandleCurrentChange" class="mt15"
show-overflow-tooltip> :pager-count="3" :page-sizes="[10, 20, 30]" v-model:current-page="state.tableData.param.pageNum" background
<template #default="scope"> v-model:page-size="state.tableData.param.pageSize" layout="total, sizes, prev, pager, next"
<el-button link type="primary" size="small" @click="deleteDisaster(scope.row)">Delete</el-button> :total="state.tableData.total">
</template> </el-pagination>
</el-table-column> <DisasterInfo ref="disasterInfoRef" @callback="getTableData" />
</el-table> </el-drawer>
<el-pagination @size-change="onHandleSizeChange"
@current-change="onHandleCurrentChange"
class="mt15"
:pager-count="3"
:page-sizes="[10, 20, 30]"
v-model:current-page="state.tableData.param.pageNum"
background
v-model:page-size="state.tableData.param.pageSize"
layout="total, sizes, prev, pager, next"
:total="state.tableData.total">
</el-pagination>
<DisasterInfo ref="disasterInfoRef" @callback="getTableData"/>
</el-drawer>
</el-config-provider> </el-config-provider>
</template> </template>
<script setup> <script setup>
import en from 'element-plus/dist/locale/en.mjs' import en from 'element-plus/dist/locale/en.mjs'
import {reactive, ref} from "vue"; import { reactive, ref } from "vue";
import DisasterInfo from './disasterInfo.vue'; import DisasterInfo from './disasterInfo.vue';
import {getPage,removeManage} from '/@/api/disasterInfo/index.js'; import { getPage, removeManage } from '/@/api/disasterInfo/index.js';
import {ElMessage, ElMessageBox} from "element-plus"; import { ElMessage, ElMessageBox } from "element-plus";
const disasterInfoRef = ref(); const disasterInfoRef = ref();
const state = reactive({ const state = reactive({
table:false, table: false,
loading:false, loading: false,
userId:null, userId: null,
multipleSelection:[], multipleSelection: [],
searchName:'', searchName: '',
tableData: { tableData: {
data: [], data: [],
total: 0, total: 0,
@ -89,7 +76,7 @@ const addDisaster = () => {
} }
//chief //chief
const batchDelete = () => { const batchDelete = () => {
if(state.multipleSelection.length == 0){ if (state.multipleSelection.length == 0) {
ElMessage.warning("Select the data to be operated first"); ElMessage.warning("Select the data to be operated first");
return false; return false;
} }
@ -98,14 +85,14 @@ const batchDelete = () => {
cancelButtonText: 'cancel', cancelButtonText: 'cancel',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
let id = state.multipleSelection.map(item=>({id:item.id,chiefId:null})) let id = state.multipleSelection.map(item => ({ id: item.id, chiefId: null }))
removeManage(id).then(res=>{ removeManage(id).then(res => {
getTableData(); getTableData();
ElMessage.success('delete successfully'); ElMessage.success('delete successfully');
})
}) })
.catch(() => {}); })
.catch(() => { });
} }
const deleteDisaster = (row) => { const deleteDisaster = (row) => {
ElMessageBox.confirm(`This operation will delete the disaster${row.dictValue}Whether to continue?`, 'tip', { ElMessageBox.confirm(`This operation will delete the disaster${row.dictValue}Whether to continue?`, 'tip', {
@ -113,14 +100,14 @@ const deleteDisaster = (row) => {
cancelButtonText: 'cancel', cancelButtonText: 'cancel',
type: 'warning', type: 'warning',
}) })
.then(() => { .then(() => {
let delData = [{"id":row.id,"cheif":null}] let delData = [{ "id": row.id, "cheif": null }]
removeManage(delData).then(res=>{ removeManage(delData).then(res => {
getTableData(); getTableData();
ElMessage.success('Deleted successfully'); ElMessage.success('Deleted successfully');
})
}) })
.catch(() => {}); })
.catch(() => { });
} }
// //
const openDialog = (userId) => { const openDialog = (userId) => {
@ -130,7 +117,7 @@ const openDialog = (userId) => {
}; };
// //
const getTableData = () => { const getTableData = () => {
getPage(state.tableData.param.pageNum,state.tableData.param.pageSize,{"chiefIdEquals":state.userId,"disasterType":state.searchName}).then(res=>{ getPage(state.tableData.param.pageNum, state.tableData.param.pageSize, { "chiefIdEquals": state.userId, "disasterType": state.searchName }).then(res => {
state.tableData.data = res.records; state.tableData.data = res.records;
state.tableData.total = res.total; state.tableData.total = res.total;
}) })
@ -155,7 +142,7 @@ defineExpose({
<style scoped> <style scoped>
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>

View File

@ -235,7 +235,7 @@ onMounted(() => {
} }
} }
.mt15 { .mt15 {
float: right; display: flex;
margin-bottom: 15px; justify-content: end;
} }
</style> </style>