Merge remote-tracking branch 'origin/main' into main

# Conflicts:
#	src/router/route.js
This commit is contained in:
李宇辰 2023-04-12 09:25:27 +08:00
commit 6d64d9996d
5 changed files with 173 additions and 193 deletions

View File

@ -0,0 +1,18 @@
import request from '/@/utils/request';
import {moduleName} from '/@/utils/request';
export function getList(params) {
return request({
url: '/api/'+moduleName+'/ui/disasterInfo/list',
method: 'get',
params,
});
}
//review
export function review(id) {
return request({
url: '/api/'+moduleName+'/ui/disasterInfo/review',
method: 'get',
params: { id },
});
}

View File

@ -56,7 +56,7 @@ export const dynamicRoutes = [
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin'],
roles: ['admin', 'chief'],
icon: 'iconfont icon-xitongshezhi',
zh: '响应管理',
},
@ -72,8 +72,8 @@ export const dynamicRoutes = [
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin'],
icon: 'iconfont icon-caidan',
roles: ['admin', 'chief'],
icon: 'iconfont icon-caidan',
zh: '用户响应管理',
},
},
@ -88,7 +88,7 @@ export const dynamicRoutes = [
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin'],
roles: ['admin', 'chief'],
icon: 'ele-ColdDrink',
zh: '管理员管理',
},

View File

@ -3,7 +3,7 @@ import { ElMessage, ElMessageBox } from 'element-plus';
import qs from 'qs';
import { Session } from '/@/utils/storage';
export const moduleName = 'zqq-biz-vordm';
export const moduleName = 'yyhouc-biz-vordm';
// 配置新建一个 axios 实例
const service = axios.create({

View File

@ -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"
:total="state.tableData.total">
<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,125 +104,127 @@
</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"
:total="state.tableData.total">
<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'));
//
const roleDialogRef = ref();
const state = reactive({
tableData: {
data: [],
total: 0,
loading: false,
param: {
search: '',
pageNum: 1,
pageSize: 10,
},
},
tableData: {
data: [],
total: 0,
loading: false,
param: {
search: '',
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(),
});
}
state.tableData.data = data;
state.tableData.total = state.tableData.data.length;
setTimeout(() => {
state.tableData.loading = false;
}, 500);
state.tableData.loading = true;
//activeNametab
if(activeName.value === 'first'){
state.tableData.param.respondStatus = 0;
}else{
state.tableData.param.respondStatus = 1;
}
getList(state.tableData.param).then((res) => {
state.tableData.data = res.records;
state.tableData.total = res.total;
state.tableData.loading = false;
});
};
//
// 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;
getTableData();
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) => {
state.tableData.param.pageNum = val;
getTableData();
console.log(val);
state.tableData.param.pageNum = val;
getTableData();
};
//
onMounted(() => {
getTableData();
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 {
padding: 0px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
.demo-tabs>.el-tabs__content {
padding: 0px;
color: #6b778c;
font-size: 32px;
font-weight: 600;
}
.system-role-container {
.system-role-padding {
padding: 15px;
.el-table {
flex: 1;
}
}
.system-role-padding {
padding: 15px;
.el-table {
flex: 1;
}
}
}
</style>

View File

@ -134,6 +134,7 @@ const onSubmit = () => {
});
//statustrue01
state.ruleForm.isSealed = state.ruleForm.status ? 0 : 1;
state.ruleForm.CODE = state.ruleForm.dictKey;
update(state.ruleForm).then((res) => {
closeDialog();
emit('refresh');