zqq:更改路由配置

This commit is contained in:
qqGroup0 2023-03-30 18:10:53 +08:00
parent 3f92797912
commit de315fd34e
5 changed files with 438 additions and 157 deletions

View File

@ -39,7 +39,7 @@ export const dynamicRoutes = [
isKeepAlive: true,
isAffix: true,
isIframe: false,
roles: ['admin', 'common'],
roles: ['admin', 'chief'],
icon: 'iconfont icon-shouye',
},
},
@ -100,201 +100,216 @@ export const dynamicRoutes = [
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin'],
roles: ['admin', 'chief'],
icon: 'iconfont icon-icon-',
},
},
],
},
{
path: '/dataAcquisitionService',
name: 'dataAcquisitionService',
component: () => import('/@/views/dataAcquisitionService/multimediaData/index.vue'),
redirect: '/dataAcquisitionService/multimediaData',
path: '/dataService',
name: 'dataService',
component: () => import('/@/views/dataService/multimediaData/index.vue'),
redirect: '/dataService/multimediaData',
meta: {
title: 'Data acquisition service',
title: 'Data service',
isLink: '',
isHide: false,
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin'],
roles: ['admin', 'chief'],
icon: 'iconfont icon-xitongshezhi',
},
children: [
{
path: '/dataAcquisitionService/multimediaData',
path: '/dataService/multimediaData',
name: 'multimediaData',
component: () => import('/@/views/dataAcquisitionService/multimediaData/index.vue'),
component: () => import('/@/views/dataService/multimediaData/index.vue'),
meta: {
title: 'Multimedia data acquisition service',
title: 'Multimedia data service',
isLink: '',
isHide: false,
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin'],
roles: ['admin', 'chief'],
icon: 'iconfont icon-caidan',
},
},
{
path: '/dataAcquisitionService/remoteSensingData',
path: '/dataService/remoteSensingData',
name: 'remoteSensingData',
component: () => import('/@/views/dataAcquisitionService/remoteSensingData/index.vue'),
component: () => import('/@/views/dataService/remoteSensingData/index.vue'),
meta: {
title: 'Remote sensing data acquisition service',
title: 'Remote sensing data service',
isLink: '',
isHide: false,
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin'],
roles: ['admin', 'chief'],
icon: 'ele-ColdDrink',
},
},
{
path: '/dataService/otherData',
name: 'otherData',
component: () => import('/@/views/dataService/otherData/index.vue'),
meta: {
title: 'other data service',
isLink: '',
isHide: false,
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin', 'chief'],
icon: 'ele-ColdDrink',
},
},
],
},
{
path: '/dataUploadAndRetrieval',
name: 'dataUploadAndRetrieval',
component: () => import('/@/views/dataUploadAndRetrieval/dataUpload/index.vue'),
redirect: '/dataUploadAndRetrieval/data-upload',
meta: {
title: 'Data upload and retrieval',
isLink: '',
isHide: false,
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin'],
icon: 'iconfont icon-xitongshezhi',
},
children: [
{
path: '/dataUploadAndRetrieval/dataUpload',
name: 'dataUpload',
component: () => import('/@/views/dataUploadAndRetrieval/dataUpload/index.vue'),
meta: {
title: 'Data upload',
isLink: '',
isHide: false,
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin'],
icon: 'iconfont icon-caidan',
},
},
{
path: '/dataUploadAndRetrieval/dataRetrieval',
name: 'dataRetrieval',
component: () => import('/@/views/dataUploadAndRetrieval/dataRetrieval/index.vue'),
meta: {
title: 'Data retrieval',
isLink: '',
isHide: false,
isKeepAlive: true,
isAffix: false,
isIframe: false,
roles: ['admin'],
icon: 'ele-ColdDrink',
},
},
],
},
{
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',
},
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',
},
},
],
},
// {
// path: '/dataUploadAndRetrieval',
// name: 'dataUploadAndRetrieval',
// component: () => import('/@/views/dataUploadAndRetrieval/dataUpload/index.vue'),
// redirect: '/dataUploadAndRetrieval/data-upload',
// meta: {
// title: 'Data upload and retrieval',
// isLink: '',
// isHide: false,
// isKeepAlive: true,
// isAffix: false,
// isIframe: false,
// roles: ['admin'],
// icon: 'iconfont icon-xitongshezhi',
// },
// children: [
// {
// path: '/dataUploadAndRetrieval/dataUpload',
// name: 'dataUpload',
// component: () => import('/@/views/dataUploadAndRetrieval/dataUpload/index.vue'),
// meta: {
// title: 'Data upload',
// isLink: '',
// isHide: false,
// isKeepAlive: true,
// isAffix: false,
// isIframe: false,
// roles: ['admin'],
// icon: 'iconfont icon-caidan',
// },
// },
// {
// path: '/dataUploadAndRetrieval/dataRetrieval',
// name: 'dataRetrieval',
// component: () => import('/@/views/dataUploadAndRetrieval/dataRetrieval/index.vue'),
// meta: {
// title: 'Data retrieval',
// isLink: '',
// isHide: false,
// isKeepAlive: true,
// isAffix: false,
// isIframe: false,
// roles: ['admin'],
// icon: 'ele-ColdDrink',
// },
// },
// ],
// },
// {
// 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',
// },
// 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',
// },
// },
// ],
// },
],
},
];

View File

@ -0,0 +1,266 @@
<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">
<!-- 选择灾害类型下拉框 -->
<el-select v-model="value_disastertype"
size="default"
placeholder="Select disaster type">
<el-option v-for="item in options_disastertype"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
<!-- 选择灾害时间下拉框 -->
<el-date-picker v-model="value_disastertime"
type="date"
placeholder="Select disaster time"
class="ml10"
size="default" />
<!-- 选择灾害事件下拉框 -->
<el-select v-model="value_disasterevent"
size="default"
placeholder="Select disaster event"
class="ml10">
<el-option v-for="item in options_disasterevent"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
<!-- 选择数据类型下拉框 -->
<el-select v-model="value_datatype"
size="default"
placeholder="Select data type"
class="ml10">
<el-option v-for="item in options_datatype"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
<!-- 选择是否可视化下拉框 -->
<!-- <el-select v-model="value_visualization" size="default" placeholder="Visualization" class="ml10">
<el-option v-for="item in options_visualization" :key="item.value" :label="item.label" :value="item.value" />
</el-select> -->
<!-- <el-input v-model="state.tableData.param.search" size="default" placeholder="请输入角色名称" style="max-width: 180px"> </el-input> -->
<el-button size="default"
type="primary"
class="ml10">
<el-icon>
<ele-Search />
</el-icon>
Search
</el-button>
<el-button size="default"
type="success"
class="ml10">
<el-icon>
<ele-Search />
</el-icon>
Upload
</el-button>
<!-- <el-button size="default" type="success" class="ml10" @click="onOpenAddRole('add')">
<el-icon>
<ele-FolderAdd />
</el-icon>
新增角色
</el-button> -->
</div>
<!-- <el-table :data="state.tableData.data" v-loading="state.tableData.loading" style="width: 100%">
<el-table-column type="vordmId" label="VoRDM ID" show-overflow-tooltip />
<el-table-column prop="disasterKeyword" label="Disaster keyword" show-overflow-tooltip></el-table-column>
<el-table-column prop="disasterTime" label="Disaster time" show-overflow-tooltip></el-table-column>
<el-table-column prop="crawlertype" label="Crawler type" show-overflow-tooltip></el-table-column>
<el-table-column prop="crawlerStatus" label="Crawler status" show-overflow-tooltip></el-table-column> -->
<!-- 需修改弹出框页面 -->
<!-- <el-table-column label="Crawler operation" width="100">
<template #default="scope">
<el-button size="small" text type="primary" @click="onOpenEditRole('edit', scope.row)">Start</el-button>
<el-button size="small" text type="primary" @click="onRowDel(scope.row)">Stop</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()" />
</div>
</template>
<script setup name="systemRole">
import { defineAsyncComponent, reactive, onMounted, ref } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
//
const RoleDialog = defineAsyncComponent(() => import('/@/views/system/role/dialog.vue'));
const value_disastertype = ref('');
const value_disastertime = ref('');
const value_datatype = ref('');
const value_crawlerstatus = ref('');
//
const options_disastertype = [
{
value: 'Earthquake',
label: 'Earthquake',
},
{
value: 'Hurricane',
label: 'Hurricane',
},
{
value: 'Flood',
label: 'Flood',
},
{
value: 'Volcano',
label: 'Volcano',
},
{
value: 'Drought',
label: 'Drought',
},
{
value: 'Landslide',
label: 'Landslide',
},
];
//
const options_datatype = [
{
value: 'Basic data',
label: 'Basic data',
},
{
value: 'News picture',
label: 'News picture',
},
{
value: 'Disaster report',
label: 'Disaster report',
},
{
value: 'Disaster mapping',
label: 'Disaster mapping',
},
{
value: 'Word cloud',
label: 'Word cloud',
},
{
value: 'Hotspot area',
label: 'Hotspot area',
},
];
//
const options_visualization = [
{
value: 'Yes',
label: 'Yes',
},
{
value: 'No',
label: 'No',
},
];
//
const roleDialogRef = ref();
const state = reactive({
tableData: {
data: [],
total: 0,
loading: false,
param: {
search: '',
pageNum: 1,
pageSize: 10,
},
},
});
//
const getTableData = () => {
state.tableData.loading = true;
const data = [];
for (let i = 0; i < 20; i++) {
data.push({
roleName: i === 0 ? '超级管理员' : '普通用户',
roleSign: i === 0 ? 'admin' : 'common',
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);
};
//
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();
};
//
const onHandleCurrentChange = (val) => {
state.tableData.param.pageNum = val;
getTableData();
};
//
onMounted(() => {
getTableData();
});
</script>
<style scoped lang="scss">
.system-role-container {
.system-role-padding {
padding: 15px;
.el-table {
flex: 1;
}
}
}
</style>