llz:后台表格
This commit is contained in:
parent
1f29266860
commit
26aec7972f
|
@ -273,6 +273,11 @@
|
|||
"fastq": "^1.6.0"
|
||||
}
|
||||
},
|
||||
"@popperjs/core": {
|
||||
"version": "npm:@sxzz/popperjs-es@2.11.7",
|
||||
"resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
|
||||
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
|
||||
},
|
||||
"@rollup/pluginutils": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
|
||||
|
@ -734,13 +739,6 @@
|
|||
"lodash-unified": "^1.0.2",
|
||||
"memoize-one": "^6.0.0",
|
||||
"normalize-wheel-es": "^1.2.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@popperjs/core": {
|
||||
"version": "npm:@sxzz/popperjs-es@2.11.7",
|
||||
"resolved": "https://registry.npmjs.org/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
|
||||
"integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"esbuild": {
|
||||
|
|
|
@ -1,5 +1,239 @@
|
|||
<template>
|
||||
<div>
|
||||
multimediaData
|
||||
</div>
|
||||
</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_crawlertype" size="default" placeholder="Select crawler type" class="ml10">
|
||||
<el-option v-for="item in options_crawlertype" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
<!-- 选择爬虫状态下拉框 -->
|
||||
<!-- <el-select v-model="value_crawlerstatus" size="default" placeholder="Select crawler status" class="ml10">
|
||||
<el-option v-for="item in options_crawlerstatus" :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>
|
||||
Start crawling
|
||||
</el-button>
|
||||
|
||||
<el-button size="default" type="warning" class="ml10">
|
||||
<el-icon>
|
||||
<ele-Search />
|
||||
</el-icon>
|
||||
Stop crawling
|
||||
</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_crawlertype = 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_crawlertype = [
|
||||
{
|
||||
value: 'Bing',
|
||||
label: 'Bing',
|
||||
},
|
||||
{
|
||||
value: 'Twitter',
|
||||
label: 'Twitter',
|
||||
},
|
||||
{
|
||||
value: 'Baidu',
|
||||
label: 'Baidu',
|
||||
},
|
||||
{
|
||||
value: 'Weibo',
|
||||
label: 'Weibo',
|
||||
},
|
||||
];
|
||||
|
||||
//选择爬虫状态下拉框
|
||||
// const options_crawlerstatus = [
|
||||
// {
|
||||
// value: 'Not crawled',
|
||||
// label: 'Not crawled',
|
||||
// },
|
||||
// {
|
||||
// value: 'Crawled',
|
||||
// label: 'Crawled',
|
||||
// },
|
||||
// ];
|
||||
|
||||
// 定义变量内容
|
||||
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>
|
||||
|
|
|
@ -1,5 +1,224 @@
|
|||
<template>
|
||||
<div>
|
||||
dataRetrieval
|
||||
</div>
|
||||
</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: '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>
|
||||
|
|
|
@ -1,5 +1,240 @@
|
|||
<template>
|
||||
<div>
|
||||
dataUpload
|
||||
</div>
|
||||
</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>
|
||||
|
|
|
@ -1,5 +1,155 @@
|
|||
<template>
|
||||
<div>
|
||||
administrator
|
||||
</div>
|
||||
</template>
|
||||
<div class="system-role-container layout-padding">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<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="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="Contact details" label="Contact details" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="vordmId" label="VoRDM ID" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="disasterType" label="Disaster type" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="applicationTime" label="Application time" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Remark" label="Remark" 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>
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.status">启用</el-tag>
|
||||
<el-tag type="info" v-else>禁用</el-tag>
|
||||
</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"
|
||||
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 lang="ts" setup name="systemRole">
|
||||
import type { TabsPaneContext } from 'element-plus';
|
||||
|
||||
const activeName = ref('first');
|
||||
|
||||
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({
|
||||
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 < 10; 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>
|
||||
.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,5 +1,156 @@
|
|||
<template>
|
||||
<div>
|
||||
dataUpload
|
||||
</div>
|
||||
</template>
|
||||
<div class="system-role-container layout-padding">
|
||||
<div class="system-role-padding layout-padding-auto layout-padding-view">
|
||||
<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="professionalTitle" label="Professional title" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="researchField" label="Research field" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="Email" label="Email" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="dataDetails" label="Data details" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="dataFormat" label="Data Format" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="dataSize" label="Data size" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column prop="uploadTime" label="Upload time" 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>
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.status">启用</el-tag>
|
||||
<el-tag type="info" v-else>禁用</el-tag>
|
||||
</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"
|
||||
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 lang="ts" setup name="systemRole">
|
||||
import type { TabsPaneContext } from 'element-plus';
|
||||
|
||||
const activeName = ref('first');
|
||||
|
||||
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({
|
||||
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 < 10; 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>
|
||||
.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,5 +1,211 @@
|
|||
<template>
|
||||
<div>
|
||||
userResponse
|
||||
</div>
|
||||
</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-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>
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.status">启用</el-tag>
|
||||
<el-tag type="info" v-else>禁用</el-tag>
|
||||
</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"
|
||||
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>
|
||||
</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-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>
|
||||
<template #default="scope">
|
||||
<el-tag type="success" v-if="scope.row.status">启用</el-tag>
|
||||
<el-tag type="info" v-else>禁用</el-tag>
|
||||
</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"
|
||||
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>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<RoleDialog ref="roleDialogRef" @refresh="getTableData()" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="systemRole">
|
||||
import type { TabsPaneContext } from 'element-plus';
|
||||
|
||||
const activeName = ref('first');
|
||||
|
||||
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({
|
||||
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 < 10; 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>
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue