pull/2/head
xingyu4j 2022-11-16 11:32:47 +08:00
parent d485b8289d
commit eed6a9a689
7 changed files with 81 additions and 18 deletions

View File

@ -110,18 +110,18 @@ const handleCreate = () => {
//
const handleUpdate = async (rowId: number) => {
setDialogTile('update')
//
const res = await ErrorCodeApi.getErrorCodeApi(rowId)
unref(formRef)?.setValues(res)
setDialogTile('update')
}
//
const handleDetail = async (rowId: number) => {
setDialogTile('detail')
//
const res = await ErrorCodeApi.getErrorCodeApi(rowId)
detailRef.value = res
setDialogTile('detail')
}
//

View File

@ -109,18 +109,18 @@ const handleCreate = () => {
//
const handleUpdate = async (rowId: number) => {
setDialogTile('update')
//
const res = await NoticeApi.getNoticeApi(rowId)
unref(formRef)?.setValues(res)
setDialogTile('update')
}
//
const handleDetail = async (rowId: number) => {
setDialogTile('detail')
//
const res = await NoticeApi.getNoticeApi(rowId)
detailRef.value = res
setDialogTile('detail')
}
//

View File

@ -34,7 +34,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
isSearch: true
},
{
title: '公告内容', // TODO 星语:详情时,公告展示有办法是 html 么?
title: '公告内容',
field: 'content',
table: {
type: 'html'

View File

@ -49,21 +49,31 @@ const crudSchemas = reactive<VxeCrudSchema>({
},
{
title: '访问令牌的有效期',
field: 'accessTokenValiditySeconds', // TODO 星语:展示时,要有 xxx 秒
field: 'accessTokenValiditySeconds',
form: {
component: 'InputNumber'
},
table: {
slots: {
default: 'accessTokenValiditySeconds_default'
}
}
},
{
title: '刷新令牌的有效期',
field: 'refreshTokenValiditySeconds', // TODO 星语:展示时,要有 xxx 秒
field: 'refreshTokenValiditySeconds',
form: {
component: 'InputNumber'
},
table: {
slots: {
default: 'refreshTokenValiditySeconds_default'
}
}
},
{
title: '授权类型',
field: 'authorizedGrantTypes', // TODO 星语:详情展示时,应该类似 table 也是多个 tag
field: 'authorizedGrantTypes',
table: {
width: 300,
slots: {
@ -74,17 +84,17 @@ const crudSchemas = reactive<VxeCrudSchema>({
{
title: '授权范围',
field: 'scopes', // TODO @星语:带输入的 SELECT
isTable: false // TODO 星语:详情展示时,应该类似 table 也是多个 tag
isTable: false
},
{
title: '自动授权范围',
field: 'autoApproveScopes', // TODO @星语:带输入的 SELECT
isTable: false // TODO 星语:详情展示时,应该类似 table 也是多个 tag
isTable: false
},
{
title: '可重定向的 URI 地址',
field: 'redirectUris', // TODO @星语:带输入的 SELECT
isTable: false // TODO 星语:详情展示时,应该类似 table 也是多个 tag
isTable: false
},
{
title: '权限',

View File

@ -12,6 +12,12 @@
@click="handleCreate()"
/>
</template>
<template #accessTokenValiditySeconds_default="{ row }">
{{ row.accessTokenValiditySeconds + '秒' }}
</template>
<template #refreshTokenValiditySeconds_default="{ row }">
{{ row.refreshTokenValiditySeconds + '秒' }}
</template>
<template #authorizedGrantTypes_default="{ row }">
<el-tag
:disable-transitions="true"
@ -61,7 +67,54 @@
v-if="actionType === 'detail'"
:schema="allSchemas.detailSchema"
:data="detailRef"
/>
>
<template #accessTokenValiditySeconds="{ row }">
{{ row.accessTokenValiditySeconds + '秒' }}
</template>
<template #refreshTokenValiditySeconds="{ row }">
{{ row.refreshTokenValiditySeconds + '秒' }}
</template>
<template #authorizedGrantTypes="{ row }">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(authorizedGrantType, index) in row.authorizedGrantTypes"
:index="index"
>
{{ authorizedGrantType }}
</el-tag>
</template>
<template #scopes="{ row }">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(scopes, index) in row.scopes"
:index="index"
>
{{ scopes }}
</el-tag>
</template>
<template #autoApproveScopes="{ row }">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(autoApproveScopes, index) in row.autoApproveScopes"
:index="index"
>
{{ autoApproveScopes }}
</el-tag>
</template>
<template #redirectUris="{ row }">
<el-tag
:disable-transitions="true"
:key="index"
v-for="(redirectUris, index) in row.redirectUris"
:index="index"
>
{{ redirectUris }}
</el-tag>
</template>
</Descriptions>
<template #footer>
<!-- 按钮保存 -->
<XButton
@ -121,17 +174,17 @@ const handleCreate = () => {
//
const handleUpdate = async (rowId: number) => {
setDialogTile('update')
//
const res = await ClientApi.getOAuth2ClientApi(rowId)
unref(formRef)?.setValues(res)
setDialogTile('update')
}
//
const handleDetail = async (rowId: number) => {
setDialogTile('detail')
const res = await ClientApi.getOAuth2ClientApi(rowId)
detailRef.value = res
setDialogTile('detail')
}
//

View File

@ -202,18 +202,18 @@ const handleCreate = () => {
//
const handleUpdate = async (rowId: number) => {
setDialogTile('update')
//
const res = await RoleApi.getRoleApi(rowId)
unref(formRef)?.setValues(res)
setDialogTile('update')
}
//
const handleDetail = async (rowId: number) => {
setDialogTile('detail')
//
const res = await RoleApi.getRoleApi(rowId)
detailRef.value = res
setDialogTile('detail')
}
//

View File

@ -113,17 +113,17 @@ const handleCreate = () => {
//
const handleUpdate = async (rowId: number) => {
setDialogTile('update')
//
const res = await SmsChannelApi.getSmsChannelApi(rowId)
unref(formRef)?.setValues(res)
setDialogTile('update')
}
//
const handleDetail = async (rowId: number) => {
setDialogTile('detail')
const res = await SmsChannelApi.getSmsChannelApi(rowId)
detailData.value = res
setDialogTile('detail')
}
//