Merge branch 'main' of http://47.92.168.204:3000/VoRDM/vordm-admin into zqq
This commit is contained in:
commit
cfc4506cda
|
@ -6,7 +6,7 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="keywords" content="VoRDM"/>
|
||||
<meta name="description" content="VoRDM"/>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel="icon" href="/src/assets/vordm-mini.png" />
|
||||
<title>VoRDM Admin</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -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: 'post',
|
||||
params: { id },
|
||||
});
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request, {moduleName} from '/@/utils/request';
|
||||
|
||||
/**
|
||||
* 查询管理员用户分页列表
|
||||
* @param current
|
||||
* @param size
|
||||
* @param params
|
||||
* @returns {Promise<AxiosResponse<any>>}
|
||||
*/
|
||||
export const getAdminManagerPage = (current,size,params) => {
|
||||
return request({
|
||||
url: '/api/' + moduleName + '/adminManager/pages',
|
||||
method: 'get',
|
||||
params: {
|
||||
current,
|
||||
size,
|
||||
...params
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增管理员
|
||||
* @param data
|
||||
* @returns {Promise<AxiosResponse<any>>}
|
||||
*/
|
||||
export const auditData = (data) => {
|
||||
return request({
|
||||
url: '/api/' + moduleName + '/adminManager/audit',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const remove = (ids) => {
|
||||
return request({
|
||||
url: '/api/' + moduleName + '/administrator/delete',
|
||||
method: 'delete',
|
||||
params: {
|
||||
ids,
|
||||
}
|
||||
})
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
import request, {moduleName} from '/@/utils/request';
|
||||
|
||||
/**
|
||||
* 查询管理员用户分页列表
|
||||
* @param current
|
||||
* @param size
|
||||
* @param params
|
||||
* @returns {Promise<AxiosResponse<any>>}
|
||||
*/
|
||||
export const getAdminPage = (current,size,params) => {
|
||||
return request({
|
||||
url: '/api/' + moduleName + '/administrator/pages',
|
||||
method: 'get',
|
||||
params: {
|
||||
current,
|
||||
size,
|
||||
...params
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增管理员
|
||||
* @param data
|
||||
* @returns {Promise<AxiosResponse<any>>}
|
||||
*/
|
||||
export const addAdmin = (data) => {
|
||||
return request({
|
||||
url: '/api/' + moduleName + '/administrator/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const remove = (ids) => {
|
||||
return request({
|
||||
url: '/api/' + moduleName + '/administrator/delete',
|
||||
method: 'delete',
|
||||
params: {
|
||||
ids,
|
||||
}
|
||||
})
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
import request from '/@/utils/request';
|
||||
var model = 'kn-setting';
|
||||
var model = 'system-manager';
|
||||
export const getList = (params) => {
|
||||
return request({
|
||||
url: '/api/'+model+'/dict-biz/list',
|
||||
|
@ -55,7 +55,7 @@ export const add = (row) => {
|
|||
|
||||
export const update = (row) => {
|
||||
return request({
|
||||
url: '/api/'+model+'/dict-biz/submit',
|
||||
url: '/api/'+model+'/dict-biz/submit2',
|
||||
method: 'post',
|
||||
data: row
|
||||
})
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 3.1 KiB |
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<div class="layout-logo" v-if="setShowLogo" @click="onThemeConfigChange">
|
||||
<img :src="logoMini" class="layout-logo-medium-img" />
|
||||
<span>{{ themeConfig.globalTitle }}</span>
|
||||
<img :src="Vordm" class="layout-logo-medium-img" />
|
||||
<!-- <span>{{ themeConfig.globalTitle }}</span>-->
|
||||
</div>
|
||||
<div class="layout-logo-size" v-else @click="onThemeConfigChange">
|
||||
<img :src="logoMini" class="layout-logo-size-img" />
|
||||
<img :src="VordmMini" class="layout-logo-size-img" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -13,6 +13,8 @@ import { computed } from 'vue';
|
|||
import { storeToRefs } from 'pinia';
|
||||
import { useThemeConfig } from '/@/stores/themeConfig';
|
||||
import logoMini from '/@/assets/logo-mini.svg';
|
||||
import Vordm from '/@/assets/vordm.png';
|
||||
import VordmMini from '/@/assets/vordm-mini.png'
|
||||
|
||||
// 定义变量内容
|
||||
const storesThemeConfig = useThemeConfig();
|
||||
|
@ -32,17 +34,18 @@ const onThemeConfigChange = () => {
|
|||
|
||||
<style scoped lang="scss">
|
||||
.layout-logo {
|
||||
width: 220px;
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: rgb(0 21 41 / 2%) 0px 1px 4px;
|
||||
color: var(--el-color-primary);
|
||||
font-size: 16px;
|
||||
margin-left: 50px;
|
||||
/*justify-content: center;*/
|
||||
/*box-shadow: rgb(0 21 41 / 2%) 0px 1px 4px;*/
|
||||
/*color: var(--el-color-primary);*/
|
||||
/*font-size: 16px;*/
|
||||
cursor: pointer;
|
||||
animation: logoAnimation 0.3s ease-in-out;
|
||||
span {
|
||||
/* span {
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
}
|
||||
|
@ -54,7 +57,7 @@ const onThemeConfigChange = () => {
|
|||
&-medium-img {
|
||||
width: 20px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
.layout-logo-size {
|
||||
width: 100%;
|
||||
|
|
|
@ -243,7 +243,7 @@ onMounted(() => {
|
|||
Session.set('refresh-token', res.refresh_token);
|
||||
})
|
||||
}
|
||||
}, 10000);
|
||||
}, 5*60*1000);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
:collapse="state.isCollapse"
|
||||
:unique-opened="getThemeConfig.isUniqueOpened"
|
||||
:collapse-transition="false"
|
||||
active-text-color="white"
|
||||
>
|
||||
<template v-for="val in menuLists">
|
||||
<el-sub-menu :index="val.path" v-if="val.children && val.children.length > 0" :key="val.path">
|
||||
|
|
|
@ -40,7 +40,7 @@ export const dynamicRoutes = [
|
|||
isAffix: true,
|
||||
isIframe: false,
|
||||
roles: ['admin', 'chief'],
|
||||
// icon: 'iconfont icon-shouye',
|
||||
icon: 'iconfont icon-shouye',
|
||||
zh: '控制台',
|
||||
},
|
||||
},
|
||||
|
@ -56,8 +56,8 @@ export const dynamicRoutes = [
|
|||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
// icon: 'iconfont icon-xitongshezhi',
|
||||
roles: ['admin', 'chief'],
|
||||
icon: 'iconfont icon-xitongshezhi',
|
||||
zh: '响应管理',
|
||||
},
|
||||
children: [
|
||||
|
@ -72,11 +72,27 @@ export const dynamicRoutes = [
|
|||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
// icon: 'iconfont icon-caidan',
|
||||
roles: ['admin', 'chief'],
|
||||
icon: 'iconfont icon-caidan',
|
||||
zh: '用户响应管理',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/responseManagement/administrator',
|
||||
name: 'administrator-management',
|
||||
component: () => import('/@/views/responseManagement/administrator/index.vue'),
|
||||
meta: {
|
||||
title: 'Administrator management',
|
||||
isLink: '',
|
||||
isHide: false,
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin', 'chief'],
|
||||
icon: 'ele-ColdDrink',
|
||||
zh: '管理员管理',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/responseManagement/dataUpload',
|
||||
name: 'data-upload-management',
|
||||
|
@ -89,7 +105,7 @@ export const dynamicRoutes = [
|
|||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin', 'chief'],
|
||||
// icon: 'iconfont icon-icon-',
|
||||
icon: 'iconfont icon-icon-',
|
||||
zh: '数据上传管理',
|
||||
},
|
||||
},
|
||||
|
@ -108,7 +124,7 @@ export const dynamicRoutes = [
|
|||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin', 'chief'],
|
||||
// icon: 'iconfont icon-xitongshezhi',
|
||||
icon: 'iconfont icon-xitongshezhi',
|
||||
zh: '数据服务',
|
||||
},
|
||||
children: [
|
||||
|
@ -124,7 +140,7 @@ export const dynamicRoutes = [
|
|||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin', 'chief'],
|
||||
// icon: 'iconfont icon-caidan',
|
||||
icon: 'iconfont icon-caidan',
|
||||
zh: '多媒体数据',
|
||||
},
|
||||
},
|
||||
|
@ -140,7 +156,7 @@ export const dynamicRoutes = [
|
|||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin', 'chief'],
|
||||
// icon: 'ele-ColdDrink',
|
||||
icon: 'ele-ColdDrink',
|
||||
zh: '遥感数据',
|
||||
},
|
||||
},
|
||||
|
@ -156,7 +172,7 @@ export const dynamicRoutes = [
|
|||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin', 'chief'],
|
||||
// icon: 'ele-ColdDrink',
|
||||
icon: 'ele-ColdDrink',
|
||||
zh: '其他数据服务',
|
||||
},
|
||||
},
|
||||
|
@ -174,8 +190,8 @@ export const dynamicRoutes = [
|
|||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
// icon: 'iconfont icon-xitongshezhi',
|
||||
roles: ['admin', 'chief'],
|
||||
icon: 'iconfont icon-xitongshezhi',
|
||||
zh: '系统管理',
|
||||
},
|
||||
children: [
|
||||
|
@ -190,41 +206,24 @@ export const dynamicRoutes = [
|
|||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
// icon: 'iconfont icon-caidan',
|
||||
roles: ['admin', 'chief'],
|
||||
icon: 'iconfont icon-caidan',
|
||||
zh: '普通管理员管理',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/systemManagement/chief',
|
||||
name: 'chiefManagement',
|
||||
component: () => import('/@/views/systemManagement/chief/index.vue'),
|
||||
path: '/system/dic',
|
||||
name: 'systemDic',
|
||||
component: () => import('/@/views/system/dic/index.vue'),
|
||||
meta: {
|
||||
title: 'Chief Administrator management',
|
||||
title: '字典管理',
|
||||
isLink: '',
|
||||
isHide: false,
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
// icon: 'ele-ColdDrink',
|
||||
zh: '主要管理员管理',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/systemManagement/dictionary',
|
||||
name: 'dictionaryManagement',
|
||||
component: () => import('/@/views/systemManagement/dictionary/index.vue'),
|
||||
meta: {
|
||||
title: 'Dictionary management',
|
||||
isLink: '',
|
||||
isHide: false,
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
// icon: 'ele-ColdDrink',
|
||||
zh: '字典管理',
|
||||
roles: ['admin', 'chief'],
|
||||
icon: 'ele-SetUp',
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@ -369,100 +368,6 @@ export const dynamicRoutes = [
|
|||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
path: '/system',
|
||||
name: 'system',
|
||||
component: () => import('/@/layout/routerView/parent.vue'),
|
||||
redirect: '/system/menu',
|
||||
meta: {
|
||||
title: '系统设置',
|
||||
isLink: '',
|
||||
isHide: false,
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
// icon: 'iconfont icon-xitongshezhi',
|
||||
zh: '系统设置',
|
||||
},
|
||||
children: [
|
||||
// {
|
||||
// path: '/system/menu',
|
||||
// name: 'systemMenu',
|
||||
// component: () => import('/@/views/system/menu/index.vue'),
|
||||
// meta: {
|
||||
// title: '菜单管理',
|
||||
// isLink: '',
|
||||
// isHide: false,
|
||||
// isKeepAlive: true,
|
||||
// isAffix: false,
|
||||
// isIframe: false,
|
||||
// roles: ['admin'],
|
||||
// icon: 'iconfont icon-caidan',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: '/system/role',
|
||||
// name: 'systemRole',
|
||||
// component: () => import('/@/views/system/role/index.vue'),
|
||||
// meta: {
|
||||
// title: '角色管理',
|
||||
// isLink: '',
|
||||
// isHide: false,
|
||||
// isKeepAlive: true,
|
||||
// isAffix: false,
|
||||
// isIframe: false,
|
||||
// roles: ['admin'],
|
||||
// icon: 'ele-ColdDrink',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: '/system/user',
|
||||
// name: 'systemUser',
|
||||
// component: () => import('/@/views/system/user/index.vue'),
|
||||
// meta: {
|
||||
// title: '用户管理',
|
||||
// isLink: '',
|
||||
// isHide: false,
|
||||
// isKeepAlive: true,
|
||||
// isAffix: false,
|
||||
// isIframe: false,
|
||||
// roles: ['admin'],
|
||||
// icon: 'iconfont icon-icon-',
|
||||
// },
|
||||
// },
|
||||
// {
|
||||
// path: '/system/dept',
|
||||
// name: 'systemDept',
|
||||
// component: () => import('/@/views/system/dept/index.vue'),
|
||||
// meta: {
|
||||
// title: '部门管理',
|
||||
// isLink: '',
|
||||
// isHide: false,
|
||||
// isKeepAlive: true,
|
||||
// isAffix: false,
|
||||
// isIframe: false,
|
||||
// roles: ['admin'],
|
||||
// icon: 'ele-OfficeBuilding',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
path: '/system/dic',
|
||||
name: 'systemDic',
|
||||
component: () => import('/@/views/system/dic/index.vue'),
|
||||
meta: {
|
||||
title: '字典管理',
|
||||
isLink: '',
|
||||
isHide: false,
|
||||
isKeepAlive: true,
|
||||
isAffix: false,
|
||||
isIframe: false,
|
||||
roles: ['admin'],
|
||||
// icon: 'ele-SetUp',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
|
@ -24,7 +24,7 @@ export const useThemeConfig = defineStore('themeConfig', {
|
|||
* 全局主题
|
||||
*/
|
||||
// 默认 primary 主题颜色
|
||||
primary: '#409eff',
|
||||
primary: '#0b7cc3',
|
||||
// 是否开启深色模式
|
||||
isIsDark: false,
|
||||
|
||||
|
@ -42,7 +42,7 @@ export const useThemeConfig = defineStore('themeConfig', {
|
|||
* 菜单设置
|
||||
*/
|
||||
// 默认菜单导航背景颜色
|
||||
menuBar: '#545c64',
|
||||
menuBar: '#0b7cc3',
|
||||
// 默认菜单导航字体颜色
|
||||
menuBarColor: '#eaeaea',
|
||||
// 默认菜单高亮背景色
|
||||
|
|
|
@ -61,6 +61,8 @@ service.interceptors.response.use(
|
|||
ElMessage.error('网络超时');
|
||||
} else if (error.message == 'Network Error') {
|
||||
ElMessage.error('网络连接错误');
|
||||
} else if (error.response && error.response.data.code == '500') {
|
||||
ElMessage.error(error.response.data.msg);
|
||||
} else {
|
||||
if (error.response.data.error_description) ElMessage.error(error.response.data.error_description);
|
||||
else {
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
<template>
|
||||
<el-dialog title="add administrator" v-model="state.isShowDialog" width="700px">
|
||||
<el-form :model="state.ruleForm" size="default" label-width="90px" :rules="rules" ref="adminAddFormRef">
|
||||
<el-form-item label="name" prop="name">
|
||||
<el-input v-model="state.ruleForm.name" placeholder="please enter name" clearable style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="email" prop="email">
|
||||
<el-input v-model="state.ruleForm.email" placeholder="please enter email" clearable style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="account" prop="account">
|
||||
<el-input v-model="state.ruleForm.account" placeholder="please enter account" clearable style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="phone" prop="phone">
|
||||
<el-input v-model="state.ruleForm.phone" placeholder="please enter phone" clearable style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="organization" prop="organization">
|
||||
<el-input v-model="state.ruleForm.organization" placeholder="please enter phone" clearable style="width: 300px"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancel" size="default">cancel</el-button>
|
||||
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">add</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {reactive, ref} from "vue";
|
||||
import {addAdmin} from '/@/api/response/administrator.js';
|
||||
import {ElMessage} from "element-plus";
|
||||
const adminAddFormRef = ref();
|
||||
const state = reactive({
|
||||
isShowDialog: false,
|
||||
isLoading:false,
|
||||
ruleForm: {
|
||||
name: '', //标样名称
|
||||
code: '',//标样编号
|
||||
states: '',//标样状态
|
||||
tableData: [],
|
||||
},
|
||||
tableData: [],
|
||||
//字典值
|
||||
dictData: [],
|
||||
unitData:[],
|
||||
standardId: '',
|
||||
detectionData: []
|
||||
})
|
||||
|
||||
//校验规则
|
||||
const rules = reactive({
|
||||
name: [
|
||||
{required: true, message: 'please enter name', trigger: 'blur'}
|
||||
],
|
||||
email: [
|
||||
{required: true, message: 'please enter email', trigger: 'blur'}
|
||||
],
|
||||
account: [
|
||||
{required: true, message: 'please enter account', trigger: 'blur'}
|
||||
],
|
||||
phone: [
|
||||
{required: true, message: 'please enter phone', trigger: 'blur'}
|
||||
],
|
||||
organization: [
|
||||
{required: true, message: 'please enter organization', trigger: 'blur'}
|
||||
]
|
||||
})
|
||||
//重置表单
|
||||
const resetField = () => {
|
||||
adminAddFormRef.value.resetFields();
|
||||
}
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = () => {
|
||||
state.isShowDialog = true;
|
||||
};
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
state.isShowDialog = false;
|
||||
//重置表格数据
|
||||
state.ruleForm.tableData = [];
|
||||
resetField();
|
||||
};
|
||||
// 取消
|
||||
const onCancel = () => {
|
||||
closeDialog();
|
||||
};
|
||||
// 新增
|
||||
const onSubmit = () => {
|
||||
adminAddFormRef.value.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
state.isLoading = true;
|
||||
addAdmin(state.ruleForm).then(res => {
|
||||
ElMessage.success("Add successfully");
|
||||
emit('callback');
|
||||
}).catch(err => {
|
||||
ElMessage.error("Add failure");
|
||||
}).finally(()=>{
|
||||
state.isLoading = false;
|
||||
})
|
||||
closeDialog();
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -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,40 @@
|
|||
</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===2">Reviewed</el-tag>
|
||||
<el-tag type="info" v-if="scope.row.respondStatus===1">Failed</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 +105,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) => {
|
||||
state.selectName=tab.props.name;
|
||||
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 +141,80 @@ const state = reactive({
|
|||
loading: false,
|
||||
param: {
|
||||
search: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
current: 1,
|
||||
size: 10,
|
||||
respondStatus:0,
|
||||
},
|
||||
},
|
||||
disasterTypeList: [],
|
||||
selectName: 'first',
|
||||
});
|
||||
// 初始化表格数据
|
||||
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(state.selectName === 'first'){
|
||||
state.tableData.param.respondStatus = 0;
|
||||
}else{
|
||||
state.tableData.param.respondStatus = 2;
|
||||
}
|
||||
state.tableData.data = data;
|
||||
state.tableData.total = state.tableData.data.length;
|
||||
setTimeout(() => {
|
||||
console.log(activeName.value);
|
||||
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 +224,7 @@ onMounted(() => {
|
|||
.system-role-container {
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="字段Key">
|
||||
<el-input v-model="state.ruleForm.dictKey" placeholder="请输入字段名,拼接 ruleForm.list" clearable></el-input>
|
||||
<el-form-item label="字典值">
|
||||
<el-input v-model="state.ruleForm.dictKey" placeholder="请输入字段名,拼接 ruleForm.children" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
|
@ -23,7 +23,7 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
|
||||
<el-row :gutter="35" v-for="(v, k) in state.ruleForm.list" :key="k">
|
||||
<el-row :gutter="35" v-for="(v, k) in state.ruleForm.children" :key="k">
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item :prop="`list[${k}].label`">
|
||||
<template #label>
|
||||
|
@ -43,8 +43,8 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
<el-form-item label="字典Key" :prop="`list[${k}].value`">
|
||||
<el-input v-model="v.dictKey" style="width: 100%" placeholder="请输入字典Key"> </el-input>
|
||||
<el-form-item label="字典值" :prop="`list[${k}].value`">
|
||||
<el-input v-model="v.dictKey" style="width: 100%" placeholder="请输入字典值"> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -69,6 +69,7 @@
|
|||
<script setup name="systemDicDialog">
|
||||
import { RowAlign } from 'element-plus';
|
||||
import { reactive, ref } from 'vue';
|
||||
import { update } from '/@/api/system/dictbiz';
|
||||
|
||||
// 定义子组件向父组件传值/事件
|
||||
const emit = defineEmits(['refresh']);
|
||||
|
@ -79,9 +80,9 @@ const state = reactive({
|
|||
ruleForm: {
|
||||
dictValue: '', // 字典名称
|
||||
dictKey: '', // 字段名
|
||||
isSealed: 0, // 字典状态
|
||||
list: [], // 子集字段 + 属性值
|
||||
children: [], // 子集字段 + 属性值
|
||||
remark: '', // 字典描述
|
||||
status: false, // 字典状态
|
||||
},
|
||||
dialog: {
|
||||
isShowDialog: false,
|
||||
|
@ -91,37 +92,25 @@ const state = reactive({
|
|||
},
|
||||
});
|
||||
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (type, row) => {
|
||||
|
||||
if (type === 'edit') {
|
||||
console.log(row);
|
||||
state.ruleForm = row;
|
||||
state.ruleForm.list = row.children;
|
||||
state.status = row.isSealed === 0;
|
||||
// if (row.fieldName === 'SYS_UERINFO') {
|
||||
// row.list = [
|
||||
// { id: Math.random(), label: 'sex', value: '1' },
|
||||
// { id: Math.random(), label: 'sex', value: '0' },
|
||||
// ];
|
||||
// } else {
|
||||
// row.list = [
|
||||
// { id: Math.random(), label: 'role', value: 'admin' },
|
||||
// { id: Math.random(), label: 'role', value: 'chief' },
|
||||
// { id: Math.random(), label: 'roleName', value: '超级管理员' },
|
||||
// { id: Math.random(), label: 'roleName', value: '主要管理员' },
|
||||
// ];
|
||||
// }
|
||||
// state.ruleForm = row;
|
||||
//如果children不存在或者为空,添加一个空对象
|
||||
if (!state.ruleForm.children || state.ruleForm.children.length === 0) {
|
||||
state.ruleForm.children=[{ dictValue: '', dictKey: '' }];
|
||||
}
|
||||
state.ruleForm.status = row.isSealed === 0;
|
||||
state.dialog.title = '修改字典';
|
||||
state.dialog.submitTxt = '修 改';
|
||||
} else {
|
||||
state.dialog.title = '新增字典';
|
||||
state.dialog.submitTxt = '新 增';
|
||||
// 清空表单,此项需加表单验证才能使用
|
||||
// nextTick(() => {
|
||||
// dicDialogFormRef.value.resetFields();
|
||||
// });
|
||||
if (!state.ruleForm.children || state.ruleForm.children.length === 0) {
|
||||
state.ruleForm.children=[{ dictValue: '', dictKey: '' }];
|
||||
}
|
||||
}
|
||||
state.dialog.isShowDialog = true;
|
||||
};
|
||||
|
@ -135,13 +124,27 @@ const onCancel = () => {
|
|||
};
|
||||
// 提交
|
||||
const onSubmit = () => {
|
||||
dicDialogFormRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
//判断是否有空对象,有则删除
|
||||
state.ruleForm.children.forEach((item, index) => {
|
||||
if (!item.dictValue && !item.dictKey) {
|
||||
state.ruleForm.children.splice(index, 1);
|
||||
}
|
||||
});
|
||||
//判断status是否为true,是则赋值为0,否则赋值为1
|
||||
state.ruleForm.isSealed = state.ruleForm.status ? 0 : 1;
|
||||
state.ruleForm.CODE = state.ruleForm.dictKey;
|
||||
update(state.ruleForm).then((res) => {
|
||||
closeDialog();
|
||||
emit('refresh');
|
||||
// if (state.dialog.type === 'add') { }
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
// 新增行
|
||||
const onAddRow = () => {
|
||||
state.ruleForm.list.push({
|
||||
state.ruleForm.children.push({
|
||||
id: Math.random(),
|
||||
label: '',
|
||||
value: '',
|
||||
|
@ -149,7 +152,7 @@ const onAddRow = () => {
|
|||
};
|
||||
// 删除行
|
||||
const onDelRow = (k) => {
|
||||
state.ruleForm.list.splice(k, 1);
|
||||
state.ruleForm.children.splice(k, 1);
|
||||
};
|
||||
|
||||
// 暴露变量
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
<script setup name="systemDic">
|
||||
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
|
||||
import { ElMessageBox, ElMessage } from 'element-plus';
|
||||
import { getList } from '/@/api/system/dictbiz';
|
||||
import { getList,remove } from '/@/api/system/dictbiz';
|
||||
// 引入组件
|
||||
const DicDialog = defineAsyncComponent(() => import('/@/views/system/dic/dialog.vue'));
|
||||
|
||||
|
@ -95,12 +95,12 @@ const onRowDel = (row) => {
|
|||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
}).then(() => {
|
||||
remove(row.id).then(() => {
|
||||
getTableData();
|
||||
ElMessage.success('删除成功');
|
||||
})
|
||||
.catch(() => {});
|
||||
});
|
||||
}).catch(() => {});
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleSizeChange = (val) => {
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
<template>
|
||||
<el-dialog title="audit" v-model="state.isShowDialog" width="700px">
|
||||
<el-form :model="state.ruleForm" size="default" label-width="120px" :rules="rules" ref="adminAddFormRef">
|
||||
<el-form-item label="pass or not" prop="status">
|
||||
<el-radio-group v-model="state.ruleForm.status">
|
||||
<el-radio :label="1">pass</el-radio>
|
||||
<el-radio :label="2">no pass</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancel" size="default">cancel</el-button>
|
||||
<el-button type="primary" @click="onSubmit" size="default" :loading="state.isLoading">confirm</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {reactive, ref} from "vue";
|
||||
import {addAdmin} from '/@/api/response/administrator.js';
|
||||
import {auditData} from '/@/api/response/adminManager.js';
|
||||
import {ElMessage} from "element-plus";
|
||||
const adminAddFormRef = ref();
|
||||
const state = reactive({
|
||||
isShowDialog: false,
|
||||
isLoading:false,
|
||||
ruleForm: {
|
||||
name: '', //标样名称
|
||||
code: '',//标样编号
|
||||
states: '',//标样状态
|
||||
tableData: [],
|
||||
},
|
||||
tableData: [],
|
||||
//字典值
|
||||
dictData: [],
|
||||
unitData:[],
|
||||
standardId: '',
|
||||
detectionData: [],
|
||||
data:[],
|
||||
})
|
||||
|
||||
//校验规则
|
||||
const rules = reactive({
|
||||
status: [
|
||||
{required: true, message: 'please check pass or not', trigger: 'change'}
|
||||
]
|
||||
})
|
||||
//重置表单
|
||||
const resetField = () => {
|
||||
adminAddFormRef.value.resetFields();
|
||||
}
|
||||
|
||||
// 打开弹窗
|
||||
const openDialog = (row) => {
|
||||
console.log(row);
|
||||
state.isShowDialog = true;
|
||||
state.data = row;
|
||||
};
|
||||
// 关闭弹窗
|
||||
const closeDialog = () => {
|
||||
state.isShowDialog = false;
|
||||
//重置表格数据
|
||||
state.ruleForm.tableData = [];
|
||||
resetField();
|
||||
};
|
||||
// 取消
|
||||
const onCancel = () => {
|
||||
closeDialog();
|
||||
};
|
||||
// 新增
|
||||
const onSubmit = () => {
|
||||
adminAddFormRef.value.validate((valid, fields) => {
|
||||
if (valid) {
|
||||
state.isLoading = true;
|
||||
state.data.map(item=>item.status = state.ruleForm.status);
|
||||
auditData(state.data).then(res => {
|
||||
ElMessage.success("Audit successfully");
|
||||
emit('callback');
|
||||
}).catch(err => {
|
||||
|
||||
}).finally(()=>{
|
||||
state.isLoading = false;
|
||||
})
|
||||
closeDialog();
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
// 暴露变量
|
||||
defineExpose({
|
||||
openDialog,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -1,5 +1,188 @@
|
|||
<template>
|
||||
<div>
|
||||
<h3>普通管理员注册审核管理</h3>
|
||||
<div class="system-role-container layout-padding">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<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"
|
||||
clearable></el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
<ele-Search/>
|
||||
</el-icon>
|
||||
search
|
||||
</el-button>
|
||||
<!-- <el-button size="default" type="success" class="ml10" @click="addUser">
|
||||
<el-icon>
|
||||
<ele-FolderAdd/>
|
||||
</el-icon>
|
||||
add
|
||||
</el-button>-->
|
||||
</div>
|
||||
<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="disasterType"
|
||||
label="DisasterType"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterCountry"
|
||||
label="DisasterCountry"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterKeyword"
|
||||
label="DisasterKeyword"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterLevel"
|
||||
label="DisasterLevel"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterTime"
|
||||
label="DisasterTime"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="managerName"
|
||||
label="ManagerName"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="sponsorOrganization"
|
||||
label="SponsorOrganization"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Operate"
|
||||
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="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>
|
||||
</div>
|
||||
<RoleDialog ref="roleDialogRef"
|
||||
@refresh="getTableData()" />
|
||||
<Audit ref="auditRef" @callback="getTableData"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="systemRole">
|
||||
import type { TabsPaneContext } from 'element-plus';
|
||||
import {getAdminManagerPage,auditData} from '/@/api/response/adminManager.js';
|
||||
import Audit from './component/audit.vue';
|
||||
const activeName = ref('first');
|
||||
const auditRef = ref();
|
||||
const handleClick = (tab: TabsPaneContext, event: Event) => {
|
||||
console.log(tab, event);
|
||||
};
|
||||
|
||||
//复制内容
|
||||
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({
|
||||
searchName:'',
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
loading: false,
|
||||
param: {
|
||||
search: '',
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
},
|
||||
});
|
||||
//审核管理者可以管理这个灾害
|
||||
const auditManager = (row) => {
|
||||
auditRef.value.openDialog([{...row}]);
|
||||
/*ElMessageBox.confirm(`This operation will audit the disaster data:“${row.disasterType}”,Whether to continue?`, 'tip', {
|
||||
confirmButtonText: 'confirm',
|
||||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
auditData({"disasterId":row.disasterId,"managerId":row.managerId}).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('Deleted successfully');
|
||||
})
|
||||
})
|
||||
.catch(() => {});*/
|
||||
}
|
||||
// 初始化表格数据
|
||||
const getTableData = () => {
|
||||
state.tableData.loading = true;
|
||||
getAdminManagerPage(state.tableData.param.pageNum,state.tableData.param.pageSize,{"managerName":state.searchName}).then(res=>{
|
||||
console.log("分页数据",res);
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
state.tableData.loading = false;
|
||||
}, 500);
|
||||
};
|
||||
// 打开新增角色弹窗
|
||||
const addUser = () => {
|
||||
//administratorRef.value.openDialog();
|
||||
};
|
||||
// 打开修改角色弹窗
|
||||
const onOpenEditRole = (type, row) => {
|
||||
roleDialogRef.value.openDialog(type, row);
|
||||
};
|
||||
// 删除角色
|
||||
const deleteUser = (row) => {
|
||||
ElMessageBox.confirm(`This operation will delete the user:“${row.name}”,Whether to continue?`, 'tip', {
|
||||
confirmButtonText: 'confirm',
|
||||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
/* remove(row.id).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('Deleted successfully');
|
||||
})*/
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleSizeChange = (val) => {
|
||||
state.tableData.param.pageSize = val;
|
||||
getTableData();
|
||||
};
|
||||
// 分页改变
|
||||
const onHandleCurrentChange = (val) => {
|
||||
state.tableData.param.pageNum = val;
|
||||
getTableData();
|
||||
};
|
||||
// 页面加载时
|
||||
onMounted(() => {
|
||||
getTableData();
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.demo-tabs > .el-tabs__content {
|
||||
padding: 32px;
|
||||
color: #6b778c;
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.system-role-container {
|
||||
.system-role-padding {
|
||||
padding: 15px;
|
||||
.el-table {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,25 +1,41 @@
|
|||
<template>
|
||||
<div class="system-role-container layout-padding">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<div class="system-user-search mb15" style="display: flex;margin-left: 10px;margin-top: 10px;">
|
||||
<el-input size="default" placeholder="please enter username" style="max-width: 180px" v-model="state.searchName"
|
||||
clearable></el-input>
|
||||
<el-button size="default" type="primary" class="ml10" @click="getTableData">
|
||||
<el-icon>
|
||||
<ele-Search/>
|
||||
</el-icon>
|
||||
search
|
||||
</el-button>
|
||||
<el-button size="default" type="success" class="ml10" @click="addUser">
|
||||
<el-icon>
|
||||
<ele-FolderAdd/>
|
||||
</el-icon>
|
||||
add
|
||||
</el-button>
|
||||
</div>
|
||||
<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"
|
||||
<el-table-column prop="name"
|
||||
label="User name"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Email"
|
||||
<el-table-column prop="email"
|
||||
label="Email"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Organization"
|
||||
<el-table-column prop="organization"
|
||||
label="Organization"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Contact details"
|
||||
<el-table-column prop="phone"
|
||||
label="Contact details"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="vordmId"
|
||||
<!-- <el-table-column prop="vordmId"
|
||||
label="VoRDM ID"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterType"
|
||||
|
@ -30,29 +46,15 @@
|
|||
show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Remark"
|
||||
label="Remark"
|
||||
show-overflow-tooltip></el-table-column>
|
||||
show-overflow-tooltip></el-table-column>-->
|
||||
<el-table-column prop="Operate"
|
||||
label="Operate"
|
||||
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="status" label="角色状态" show-overflow-tooltip>
|
||||
show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.status">启用</el-tag>
|
||||
<el-tag type="info" v-else>禁用</el-tag>
|
||||
<!-- <el-button link type="primary" size="small" @click="handleClick">Detail</el-button>-->
|
||||
<el-button link type="primary" size="small" @click="deleteUser(scope.row)">Delete</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template #default="scope">
|
||||
<el-button :disabled="scope.row.roleName === '超级管理员'" size="small" text type="primary" @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>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<el-pagination @size-change="onHandleSizeChange"
|
||||
@current-change="onHandleCurrentChange"
|
||||
|
@ -66,6 +68,7 @@
|
|||
:total="state.tableData.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
<AddAdministrator ref="administratorRef" @callback="getTableData"/>
|
||||
<RoleDialog ref="roleDialogRef"
|
||||
@refresh="getTableData()" />
|
||||
</div>
|
||||
|
@ -73,9 +76,10 @@
|
|||
|
||||
<script lang="ts" setup name="systemRole">
|
||||
import type { TabsPaneContext } from 'element-plus';
|
||||
|
||||
import AddAdministrator from './component/addAdministrator.vue';
|
||||
import {getAdminPage,remove} from '/@/api/response/administrator.js';
|
||||
const activeName = ref('first');
|
||||
|
||||
const administratorRef = ref();
|
||||
const handleClick = (tab: TabsPaneContext, event: Event) => {
|
||||
console.log(tab, event);
|
||||
};
|
||||
|
@ -90,6 +94,7 @@ const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialo
|
|||
// 定义变量内容
|
||||
const roleDialogRef = ref();
|
||||
const state = reactive({
|
||||
searchName:'',
|
||||
tableData: {
|
||||
data: [],
|
||||
total: 0,
|
||||
|
@ -104,41 +109,36 @@ const state = reactive({
|
|||
// 初始化表格数据
|
||||
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;
|
||||
getAdminPage(state.tableData.param.pageNum,state.tableData.param.pageSize,{"name_like":state.searchName}).then(res=>{
|
||||
console.log("分页数据",res);
|
||||
state.tableData.data = res.records;
|
||||
state.tableData.total = res.total;
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
state.tableData.loading = false;
|
||||
}, 500);
|
||||
};
|
||||
// 打开新增角色弹窗
|
||||
const onOpenAddRole = (type) => {
|
||||
roleDialogRef.value.openDialog(type);
|
||||
const addUser = () => {
|
||||
administratorRef.value.openDialog();
|
||||
};
|
||||
// 打开修改角色弹窗
|
||||
const onOpenEditRole = (type, row) => {
|
||||
roleDialogRef.value.openDialog(type, row);
|
||||
};
|
||||
// 删除角色
|
||||
const onRowDel = (row) => {
|
||||
ElMessageBox.confirm(`此操作将永久删除角色名称:“${row.roleName}”,是否继续?`, '提示', {
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '取消',
|
||||
const deleteUser = (row) => {
|
||||
ElMessageBox.confirm(`This operation will delete the user:“${row.name}”,Whether to continue?`, 'tip', {
|
||||
confirmButtonText: 'confirm',
|
||||
cancelButtonText: 'cancel',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
remove(row.id).then(res=>{
|
||||
getTableData();
|
||||
ElMessage.success('删除成功');
|
||||
ElMessage.success('Deleted successfully');
|
||||
})
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue