fix: bugs

pull/31/head
xingyu 2023-08-12 20:19:08 +08:00
parent e2b07b92e0
commit d38413c1e4
4 changed files with 3 additions and 61 deletions

View File

@ -1,58 +0,0 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { List } from 'ant-design-vue'
import { formSchema } from '../redis.data'
import { useI18n } from '@/hooks/web/useI18n'
import { BasicForm, useForm } from '@/components/Form'
import { BasicModal, useModalInner } from '@/components/Modal'
import { deleteKey, getKeyList } from '@/api/infra/redis'
defineOptions({ name: 'RedisModal' })
const { t } = useI18n()
const listData = ref<any[]>([])
const [registerForm, { setFieldsValue, resetFields }] = useForm({
labelWidth: 120,
baseColProps: { span: 24 },
schemas: formSchema,
showActionButtonGroup: false,
actionColOptions: { span: 23 },
})
const [registerModal, { setModalProps }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false })
const res = await getKeyList(data.record)
listData.value = res
})
async function handleKeyValue(item) {
const res = await getKeyList(item)
setFieldsValue({ ...res })
}
function handleDeleteKey(item) {
deleteKey(item)
}
</script>
<template>
<BasicModal v-bind="$attrs" title="缓存模块" @register="registerModal">
<List :data-source="listData">
<template #renderItem="{ item }">
<List.Item>
<template #actions>
<a @click="handleDeleteKey(item)">{{ t('action.delete') }}</a>
</template>
<List.Item.Meta>
<template #title>
<a @click="handleKeyValue(item)">{{ item }}</a>
</template>
</List.Item.Meta>
</List.Item>
</template>
</List>
<BasicForm @register="registerForm" />
</BasicModal>
</template>

View File

@ -171,7 +171,7 @@ export const formSchema: FormSchema[] = [
// 发送邮件
// 这里加上前缀 防止和表单其他字段重名
const keyPrefix = 'key$-'
export const keyPrefix = 'key$-'
export const baseSendSchemas: FormSchema[] = [
{
field: 'code',

View File

@ -144,7 +144,7 @@ export const formSchema: FormSchema[] = [
// 发送站内信
// 这里加上前缀 防止和表单其他字段重名
const keyPrefix = 'key$-'
export const keyPrefix = 'key$-'
export const baseSendSchemas: FormSchema[] = [
{
field: 'content',

View File

@ -174,7 +174,7 @@ export const formSchema: FormSchema[] = [
// 发送短信
// 这里加上前缀 防止和表单其他字段重名
const keyPrefix = 'key$-'
export const keyPrefix = 'key$-'
export const baseSendSchemas: FormSchema[] = [
{
field: 'content',