新增角色,修改角色测试
This commit is contained in:
parent
855c43aed9
commit
e39695f0c5
@ -44,32 +44,26 @@
|
||||
>
|
||||
<div style="">
|
||||
<div style="margin-bottom: 10px;">
|
||||
<div style="margin-left: 15px; margin-bottom: 15px">角色id: <a-input v-model:value="roleid" style="width: 250px" type="number" /></div>
|
||||
<div style="margin-left: 15px; margin-bottom: 15px">角色名称:<a-input v-model="updateData.name" style="width: 250px" /></div>
|
||||
<div style="margin-left: 15px; margin-bottom: 15px">角色备注:<a-input v-model="updateData.displayName" style="width: 250px;" /></div>
|
||||
<div style="margin-left: 15px; margin-bottom: 15px">角色id: <a-input v-model:value="updateData.id" style="width: 250px" type="number" /></div>
|
||||
<div style="margin-left: 15px; margin-bottom: 15px">角色名称:<a-input v-model:value="updateData.name" style="width: 250px" /></div>
|
||||
<div style="margin-left: 15px; margin-bottom: 15px">角色备注:<a-input v-model:value="updateData.displayName" style="width: 250px;" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
|
||||
<div class="table">
|
||||
<a-table :columns="columns" :data-source="states.data" :pagination="pagination" :row-selection="rowSelection"
|
||||
<a-table :columns="columns" :data-source="states.data" :row-selection="rowSelection"
|
||||
:loading="loading"
|
||||
@change="handleTableChange">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'role_name'">
|
||||
{{ record.role_name }}
|
||||
<template v-if="column.key === 'roleName'">
|
||||
{{ record.roleName }}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'role_id'">
|
||||
{{record.role_id}}
|
||||
<template v-else-if="column.key === 'displayName'">
|
||||
{{record.displayName}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'role_state'">
|
||||
<a-tag
|
||||
v-for="tag in record.role_state"
|
||||
:key="tag"
|
||||
:color="tag === 'loser' ? 'volcano' : tag.length > 5 ? 'geekblue' : 'green'"
|
||||
>
|
||||
{{ tag.toUpperCase() }}
|
||||
</a-tag>
|
||||
<template v-else-if="column.key === 'id'">
|
||||
{{record.id}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'createdAt'">
|
||||
{{record.createdAt}}
|
||||
@ -103,10 +97,10 @@ const roleid = ref('');
|
||||
const AddDiaLog = ref(false);
|
||||
const DeleteDiaLog = ref(false);
|
||||
const editDiaLog = ref(false);
|
||||
const token = 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNiIsImV4cCI6MTcwNzA0OTQxM30.E5c9_3_PTAKUpCTXmgX7PCN5giV9zp66b1JUesxXURM'
|
||||
const token = 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNiIsImV4cCI6MTcwNzk3NDM1MH0.pi7yFk4RMrUuAhfIz7DEtSahOWwNi55A4vCXimf4Eyo'
|
||||
const states = reactive({
|
||||
data:[]
|
||||
})
|
||||
});
|
||||
const updateData = reactive({
|
||||
id: 0,
|
||||
name: '',
|
||||
@ -159,6 +153,8 @@ const addData = reactive({
|
||||
|
||||
function showAddDiaLog(){
|
||||
AddDiaLog.value = true;
|
||||
addData.name = '';
|
||||
addData.displayName = '';
|
||||
}
|
||||
|
||||
function addOk () {
|
||||
@ -271,18 +267,18 @@ function searchRole(){
|
||||
const columns = [
|
||||
{
|
||||
title: '角色名称',
|
||||
dataIndex: 'role_name',
|
||||
key: 'role_name',
|
||||
dataIndex: 'roleName',
|
||||
key: 'roleName',
|
||||
},
|
||||
{
|
||||
title: '角色备注',
|
||||
dataIndex: 'displayName',
|
||||
key:'displayName',
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
dataIndex: 'role_id',
|
||||
key: 'role_id',
|
||||
},
|
||||
{
|
||||
title: '角色状态',
|
||||
dataIndex: 'role_state',
|
||||
key: 'role_state',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
|
@ -208,7 +208,7 @@ const EditDiaLog = ref(false);
|
||||
let dataSource = ref([]);
|
||||
let data = ref([]);
|
||||
const dataLoaded = ref(false);
|
||||
const token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNiIsImV4cCI6MTcwNzA0OTQxM30.E5c9_3_PTAKUpCTXmgX7PCN5giV9zp66b1JUesxXURM"
|
||||
const token = "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNiIsImV4cCI6MTcwNzk3NDM1MH0.pi7yFk4RMrUuAhfIz7DEtSahOWwNi55A4vCXimf4Eyo"
|
||||
const requestBody = {
|
||||
"page": null,
|
||||
"limit": null,
|
||||
@ -523,7 +523,7 @@ async function fetchData() {
|
||||
search: null,
|
||||
role: null
|
||||
},
|
||||
"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNiIsImV4cCI6MTcwNzA0OTQxM30.E5c9_3_PTAKUpCTXmgX7PCN5giV9zp66b1JUesxXURM"
|
||||
"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxNiIsImV4cCI6MTcwNzk3NDM1MH0.pi7yFk4RMrUuAhfIz7DEtSahOWwNi55A4vCXimf4Eyo"
|
||||
);
|
||||
console.log(queryData.data); // 访问数据
|
||||
dataSource.value = queryData.data.data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user