|
|
|
@ -1,51 +1,36 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="system-role-container layout-padding">
|
|
|
|
|
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
|
|
|
|
<el-tabs v-model="activeName"
|
|
|
|
|
class="demo-tabs"
|
|
|
|
|
@tab-click="handleClick"
|
|
|
|
|
style="margin-left: 20px">
|
|
|
|
|
<el-tab-pane label="Not reviewed"
|
|
|
|
|
name="first">
|
|
|
|
|
<el-table :data="state.tableData.data"
|
|
|
|
|
v-loading="state.tableData.loading"
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column type="index"
|
|
|
|
|
label="ID"
|
|
|
|
|
width="50" />
|
|
|
|
|
<el-table-column prop="userName"
|
|
|
|
|
label="User name"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="Organization"
|
|
|
|
|
label="Organization"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="disasterType"
|
|
|
|
|
label="Disaster type"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="disasterKeyword"
|
|
|
|
|
label="Disaster keyword"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="affectedCountry"
|
|
|
|
|
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="Latitude"
|
|
|
|
|
label="Latitude"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="disasterTime"
|
|
|
|
|
label="Disaster time"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<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="responseStatus"
|
|
|
|
|
label="Response status"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick" style="margin-left: 20px">
|
|
|
|
|
<el-tab-pane label="Not reviewed" name="first">
|
|
|
|
|
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
|
|
|
|
|
<el-table-column type="index" label="ID" width="50" />
|
|
|
|
|
<el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="organization" label="Organization" show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
|
|
|
|
|
<!-- 在disasterType中获取dictKey 对应的dictValue -->
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column>
|
|
|
|
|
<!-- <el-table-column prop="affectedCountry" 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="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
|
|
|
|
|
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
|
|
|
|
|
<!-- <el-table-column prop="responseTime" label="Response time" show-overflow-tooltip></el-table-column> -->
|
|
|
|
|
<el-table-column prop="respondStatus" label="Response status" show-overflow-tooltip>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tag type="info" v-if="scope.row.respondStatus===0">Not reviewed</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="Operate" label="Operate" show-overflow-tooltip>
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button size="small" text type="primary" @click="onOpenEditRole('edit', scope.row)"
|
|
|
|
|
>Review</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</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> -->
|
|
|
|
@ -66,65 +51,39 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column> -->
|
|
|
|
|
</el-table>
|
|
|
|
|
<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.pageNum"
|
|
|
|
|
background
|
|
|
|
|
v-model:page-size="state.tableData.param.pageSize"
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
<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
|
|
|
|
|
v-model:page-size="state.tableData.param.size" layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
:total="state.tableData.total">
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="Reviewed"
|
|
|
|
|
name="second">
|
|
|
|
|
<el-table :data="state.tableData.data"
|
|
|
|
|
v-loading="state.tableData.loading"
|
|
|
|
|
style="width: 100%">
|
|
|
|
|
<el-table-column type="index"
|
|
|
|
|
label="ID"
|
|
|
|
|
width="50" />
|
|
|
|
|
<el-table-column prop="userName"
|
|
|
|
|
label="User name"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="Administrator"
|
|
|
|
|
label="Administrator"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="Email"
|
|
|
|
|
label="Email"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="Organization"
|
|
|
|
|
label="Organization"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="Disaster type"
|
|
|
|
|
label="Disaster type"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="Disaster keyword"
|
|
|
|
|
label="Disaster keyword"
|
|
|
|
|
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="Latitude"
|
|
|
|
|
label="Latitude"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="disasterTime"
|
|
|
|
|
label="Disaster time"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<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="responseStatus"
|
|
|
|
|
label="Response status"
|
|
|
|
|
show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-tab-pane label="Reviewed" name="second">
|
|
|
|
|
<el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
|
|
|
|
|
<el-table-column type="index" label="ID" width="50" />
|
|
|
|
|
<el-table-column prop="username" label="User name" show-overflow-tooltip></el-table-column>
|
|
|
|
|
<!-- <el-table-column prop="Administrator" label="Administrator" show-overflow-tooltip></el-table-column> -->
|
|
|
|
|
<el-table-column prop="organization" label="Organization" show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="email" label="Email" show-overflow-tooltip></el-table-column>
|
|
|
|
|
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip>
|
|
|
|
|
<!-- 在disasterType中获取dictKey 对应的dictValue -->
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-tag type="info">{{ getValue(scope.row.disasterType) }}</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="disasterKeyword" label="Disaster keyword" 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="Latitude" label="Latitude" show-overflow-tooltip></el-table-column> -->
|
|
|
|
|
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
|
|
|
|
|
<!-- <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">
|
|
|
|
|
<el-tag type="info" v-if="scope.row.respondStatus!==0">reviewed</el-tag>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
</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> -->
|
|
|
|
@ -145,38 +104,30 @@
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column> -->
|
|
|
|
|
</el-table>
|
|
|
|
|
<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.pageNum"
|
|
|
|
|
background
|
|
|
|
|
v-model:page-size="state.tableData.param.pageSize"
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
<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
|
|
|
|
|
v-model:page-size="state.tableData.param.size" layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
:total="state.tableData.total">
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
</div>
|
|
|
|
|
<RoleDialog ref="roleDialogRef"
|
|
|
|
|
@refresh="getTableData()" />
|
|
|
|
|
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup name="systemRole">
|
|
|
|
|
import type { TabsPaneContext } from 'element-plus';
|
|
|
|
|
<script setup name="userResponse">
|
|
|
|
|
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
|
|
|
|
|
import { ElMessageBox, ElMessage} from 'element-plus';
|
|
|
|
|
import {getList ,review } from '/@/api/disasterInfo/index';
|
|
|
|
|
import { getDictionary } from '/@/api/system/dictbiz';
|
|
|
|
|
|
|
|
|
|
const activeName = ref('first');
|
|
|
|
|
|
|
|
|
|
const handleClick = (tab: TabsPaneContext, event: Event) => {
|
|
|
|
|
console.log(tab, event);
|
|
|
|
|
const handleClick = (tab ,event) => {
|
|
|
|
|
console.log(activeName,tab, event);
|
|
|
|
|
// getTableData();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//复制内容
|
|
|
|
|
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
|
|
|
|
|
import { ElMessageBox, ElMessage } from 'element-plus';
|
|
|
|
|
|
|
|
|
|
// 引入组件
|
|
|
|
|
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
|
|
|
|
|
|
|
|
|
@ -189,69 +140,78 @@ const state = reactive({
|
|
|
|
|
loading: false,
|
|
|
|
|
param: {
|
|
|
|
|
search: '',
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
current: 1,
|
|
|
|
|
size: 10,
|
|
|
|
|
respondStatus:0,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
disasterTypeList: [],
|
|
|
|
|
});
|
|
|
|
|
// 初始化表格数据
|
|
|
|
|
const getTableData = () => {
|
|
|
|
|
state.tableData.loading = true;
|
|
|
|
|
const data = [];
|
|
|
|
|
for (let i = 0; i < 10; i++) {
|
|
|
|
|
data.push({
|
|
|
|
|
roleName: i === 0 ? '超级管理员' : '主要管理员',
|
|
|
|
|
roleSign: i === 0 ? 'admin' : 'chief',
|
|
|
|
|
describe: `测试角色${i + 1}`,
|
|
|
|
|
sort: i,
|
|
|
|
|
status: true,
|
|
|
|
|
createTime: new Date().toLocaleString(),
|
|
|
|
|
});
|
|
|
|
|
//根据activeName的值来判断是哪个tab页
|
|
|
|
|
if(activeName.value === 'first'){
|
|
|
|
|
state.tableData.param.respondStatus = 0;
|
|
|
|
|
}else{
|
|
|
|
|
state.tableData.param.respondStatus = 1;
|
|
|
|
|
}
|
|
|
|
|
state.tableData.data = data;
|
|
|
|
|
state.tableData.total = state.tableData.data.length;
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
getList(state.tableData.param).then((res) => {
|
|
|
|
|
state.tableData.data = res.records;
|
|
|
|
|
state.tableData.total = res.total;
|
|
|
|
|
state.tableData.loading = false;
|
|
|
|
|
}, 500);
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
// 打开新增角色弹窗
|
|
|
|
|
// const onOpenAddRole = (type) => {
|
|
|
|
|
// roleDialogRef.value.openDialog(type);
|
|
|
|
|
// };
|
|
|
|
|
// 打开修改角色弹窗
|
|
|
|
|
// const onOpenEditRole = (type, row) => {
|
|
|
|
|
// roleDialogRef.value.openDialog(type, row);
|
|
|
|
|
// };
|
|
|
|
|
// 删除角色
|
|
|
|
|
// const onRowDel = (row) => {
|
|
|
|
|
// ElMessageBox.confirm(`此操作将永久删除角色名称:“${row.roleName}”,是否继续?`, '提示', {
|
|
|
|
|
// confirmButtonText: '确认',
|
|
|
|
|
// cancelButtonText: '取消',
|
|
|
|
|
// type: 'warning',
|
|
|
|
|
// })
|
|
|
|
|
// .then(() => {
|
|
|
|
|
// getTableData();
|
|
|
|
|
// ElMessage.success('删除成功');
|
|
|
|
|
// })
|
|
|
|
|
// .catch(() => {});
|
|
|
|
|
// };
|
|
|
|
|
// 分页改变
|
|
|
|
|
const onHandleSizeChange = (val) => {
|
|
|
|
|
state.tableData.param.pageSize = val;
|
|
|
|
|
state.tableData.param.size = val;
|
|
|
|
|
getTableData();
|
|
|
|
|
};
|
|
|
|
|
const onOpenEditRole = (type, row) => {
|
|
|
|
|
//使用英语提示用户是否进行审核
|
|
|
|
|
ElMessageBox.confirm('Are you sure you want to review this data ?', 'Tips', {
|
|
|
|
|
confirmButtonText: 'OK',
|
|
|
|
|
cancelButtonText: 'Cancel',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
//审核通过
|
|
|
|
|
review(row.id).then(() => {
|
|
|
|
|
ElMessage({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: 'Review success!',
|
|
|
|
|
});
|
|
|
|
|
getTableData();
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
//审核不通过
|
|
|
|
|
ElMessage({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: 'Review failed!',
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
// 分页改变
|
|
|
|
|
const onHandleCurrentChange = (val) => {
|
|
|
|
|
console.log(val);
|
|
|
|
|
state.tableData.param.pageNum = val;
|
|
|
|
|
getTableData();
|
|
|
|
|
};
|
|
|
|
|
// 页面加载时
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
getTableData();
|
|
|
|
|
getDictionary({code:'disaster'}).then((res) => {
|
|
|
|
|
state.disasterTypeList = res;
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
const getValue = (key) => {
|
|
|
|
|
//返回state.disasterTypeLis 对应的value
|
|
|
|
|
return state.disasterTypeList.find((item) => item.dictKey === key)?.dictValue;
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
.demo-tabs > .el-tabs__content {
|
|
|
|
|
.demo-tabs>.el-tabs__content {
|
|
|
|
|
padding: 0px;
|
|
|
|
|
color: #6b778c;
|
|
|
|
|
font-size: 32px;
|
|
|
|
@ -261,6 +221,7 @@ onMounted(() => {
|
|
|
|
|
.system-role-container {
|
|
|
|
|
.system-role-padding {
|
|
|
|
|
padding: 15px;
|
|
|
|
|
|
|
|
|
|
.el-table {
|
|
|
|
|
flex: 1;
|
|
|
|
|
}
|
|
|
|
|