mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-06 23:25:06 +08:00
refactor: use Dialog
This commit is contained in:
@ -113,21 +113,19 @@
|
|||||||
</Table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<XModal id="dictModel" v-model="dialogVisible" :title="dialogTitle">
|
<Dialog id="dictModel" v-model="dialogVisible" :title="dialogTitle">
|
||||||
<template #default>
|
<Form
|
||||||
<Form
|
v-if="['typeCreate', 'typeUpdate'].includes(actionType)"
|
||||||
v-if="['typeCreate', 'typeUpdate'].includes(actionType)"
|
:schema="DictTypeSchemas.allSchemas.formSchema"
|
||||||
:schema="DictTypeSchemas.allSchemas.formSchema"
|
:rules="DictTypeSchemas.dictTypeRules"
|
||||||
:rules="DictTypeSchemas.dictTypeRules"
|
ref="typeFormRef"
|
||||||
ref="typeFormRef"
|
/>
|
||||||
/>
|
<Form
|
||||||
<Form
|
v-if="['dataCreate', 'dataUpdate'].includes(actionType)"
|
||||||
v-if="['dataCreate', 'dataUpdate'].includes(actionType)"
|
:schema="DictDataSchemas.allSchemas.formSchema"
|
||||||
:schema="DictDataSchemas.allSchemas.formSchema"
|
:rules="DictDataSchemas.dictDataRules"
|
||||||
:rules="DictDataSchemas.dictDataRules"
|
ref="dataFormRef"
|
||||||
ref="dataFormRef"
|
/>
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<!-- 操作按钮 -->
|
<!-- 操作按钮 -->
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<XButton
|
<XButton
|
||||||
@ -146,7 +144,7 @@
|
|||||||
/>
|
/>
|
||||||
<XButton :title="t('dialog.close')" @click="dialogVisible = false" />
|
<XButton :title="t('dialog.close')" @click="dialogVisible = false" />
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</Dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
@ -38,22 +38,20 @@
|
|||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<!-- 弹窗 -->
|
<!-- 弹窗 -->
|
||||||
<XModal id="errorCodeModel" v-model="dialogVisible" :title="dialogTitle">
|
<Dialog id="errorCodeModel" v-model="dialogVisible" :title="dialogTitle">
|
||||||
<template #default>
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<Form
|
||||||
<Form
|
v-if="['create', 'update'].includes(actionType)"
|
||||||
v-if="['create', 'update'].includes(actionType)"
|
:schema="allSchemas.formSchema"
|
||||||
:schema="allSchemas.formSchema"
|
:rules="rules"
|
||||||
:rules="rules"
|
ref="formRef"
|
||||||
ref="formRef"
|
/>
|
||||||
/>
|
<!-- 对话框(详情) -->
|
||||||
<!-- 对话框(详情) -->
|
<Descriptions
|
||||||
<Descriptions
|
v-if="actionType === 'detail'"
|
||||||
v-if="actionType === 'detail'"
|
:schema="allSchemas.detailSchema"
|
||||||
:schema="allSchemas.detailSchema"
|
:data="detailRef"
|
||||||
:data="detailRef"
|
/>
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<!-- 按钮:保存 -->
|
<!-- 按钮:保存 -->
|
||||||
<XButton
|
<XButton
|
||||||
@ -66,7 +64,7 @@
|
|||||||
<!-- 按钮:关闭 -->
|
<!-- 按钮:关闭 -->
|
||||||
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
@ -17,21 +17,20 @@
|
|||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<!-- 弹窗 -->
|
<!-- 弹窗 -->
|
||||||
<XModal id="postModel" v-model="dialogVisible" :title="dialogTitle">
|
<Dialog id="postModel" v-model="dialogVisible" :title="dialogTitle">
|
||||||
<template #default>
|
<!-- 表单:详情 -->
|
||||||
<!-- 表单:详情 -->
|
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef" />
|
||||||
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef" />
|
|
||||||
</template>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<!-- 按钮:关闭 -->
|
<!-- 按钮:关闭 -->
|
||||||
<XButton :title="t('dialog.close')" @click="dialogVisible = false" />
|
<XButton :title="t('dialog.close')" @click="dialogVisible = false" />
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// 全局相关的 import
|
// 全局相关的 import
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
|
import { useMessage } from '@/hooks/web/useMessage'
|
||||||
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
||||||
import { VxeGridInstance } from 'vxe-table'
|
import { VxeGridInstance } from 'vxe-table'
|
||||||
// 业务相关的 import
|
// 业务相关的 import
|
||||||
@ -40,6 +39,7 @@ import { getLoginLogPageApi, exportLoginLogApi, LoginLogVO } from '@/api/system/
|
|||||||
import download from '@/utils/download'
|
import download from '@/utils/download'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
// 列表相关的变量
|
// 列表相关的变量
|
||||||
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
|
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
|
||||||
const { gridOptions } = useVxeGrid<LoginLogVO>({
|
const { gridOptions } = useVxeGrid<LoginLogVO>({
|
||||||
@ -59,13 +59,14 @@ const handleDetail = async (row: LoginLogVO) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 导出操作
|
// 导出操作
|
||||||
// TODO @星语:导出需要有二次确认哈
|
|
||||||
const handleExport = async () => {
|
const handleExport = async () => {
|
||||||
const queryParams = Object.assign(
|
message.exportConfirm().then(async () => {
|
||||||
{},
|
const queryParams = Object.assign(
|
||||||
JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) // TODO @星语:这个有没办法,封装个 util 获取哈?
|
{},
|
||||||
)
|
JSON.parse(JSON.stringify(xGrid.value?.getRefMaps().refForm.value.data)) // TODO @星语:这个有没办法,封装个 util 获取哈?
|
||||||
const res = await exportLoginLogApi(queryParams)
|
)
|
||||||
download.excel(res, '登录列表.xls')
|
const res = await exportLoginLogApi(queryParams)
|
||||||
|
download.excel(res, '登录列表.xls')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -97,144 +97,137 @@
|
|||||||
</vxe-table>
|
</vxe-table>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<!-- 添加或修改菜单对话框 -->
|
<!-- 添加或修改菜单对话框 -->
|
||||||
<XModal v-model="dialogVisible" id="menuModel" :title="dialogTitle">
|
<Dialog v-model="dialogVisible" id="menuModel" :title="dialogTitle">
|
||||||
<template #default>
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<el-form
|
||||||
<el-form
|
ref="formRef"
|
||||||
ref="formRef"
|
:model="menuForm"
|
||||||
:model="menuForm"
|
:rules="rules"
|
||||||
:rules="rules"
|
:inline="true"
|
||||||
:inline="true"
|
label-width="120px"
|
||||||
label-width="120px"
|
label-position="right"
|
||||||
label-position="right"
|
>
|
||||||
>
|
<el-row :gutter="24">
|
||||||
<el-row :gutter="24">
|
<el-col :span="24">
|
||||||
<el-col :span="24">
|
<el-form-item label="上级菜单">
|
||||||
<el-form-item label="上级菜单">
|
<el-tree-select
|
||||||
<el-tree-select
|
node-key="id"
|
||||||
node-key="id"
|
v-model="menuForm.parentId"
|
||||||
v-model="menuForm.parentId"
|
:props="menuProps"
|
||||||
:props="menuProps"
|
:data="menuOptions"
|
||||||
:data="menuOptions"
|
:default-expanded-keys="[0]"
|
||||||
:default-expanded-keys="[0]"
|
check-strictly
|
||||||
check-strictly
|
/>
|
||||||
/>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="菜单类型" prop="type">
|
||||||
|
<el-radio-group v-model="menuForm.type">
|
||||||
|
<el-radio-button
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_MENU_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="菜单名称" prop="name">
|
||||||
|
<el-input v-model="menuForm.name" placeholder="请输入菜单名称" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<template v-if="menuForm.type !== 3">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="菜单图标">
|
||||||
|
<IconSelect v-model="menuForm.icon" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="菜单类型" prop="type">
|
<el-form-item label="路由地址" prop="path">
|
||||||
<el-radio-group v-model="menuForm.type">
|
<template #label>
|
||||||
<el-radio-button
|
<Tooltip
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.SYSTEM_MENU_TYPE)"
|
titel="路由地址"
|
||||||
:key="dict.value"
|
message="访问的路由地址,如:`user`。如需外网地址时,则以 `http(s)://` 开头"
|
||||||
:label="dict.value"
|
/>
|
||||||
>
|
</template>
|
||||||
{{ dict.label }}
|
<el-input v-model="menuForm.path" placeholder="请输入路由地址" clearable />
|
||||||
</el-radio-button>
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<template v-if="menuForm.type === 2">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="路由地址" prop="component">
|
||||||
|
<el-input v-model="menuForm.component" placeholder="请输入组件地址" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<template v-if="menuForm.type !== 1">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="权限标识" prop="permission">
|
||||||
|
<template #label>
|
||||||
|
<Tooltip
|
||||||
|
titel="权限标识"
|
||||||
|
message="Controller 方法上的权限字符,如:@PreAuthorize(`@ss.hasPermission('system:user:list')`)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<el-input v-model="menuForm.permission" placeholder="请输入权限标识" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="显示排序" prop="sort">
|
||||||
|
<el-input-number v-model="menuForm.sort" controls-position="right" :min="0" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="菜单状态" prop="status">
|
||||||
|
<el-radio-group v-model="menuForm.status">
|
||||||
|
<el-radio-button
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.value"
|
||||||
|
>
|
||||||
|
{{ dict.label }}
|
||||||
|
</el-radio-button>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<template v-if="menuForm.type !== 3">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="显示状态" prop="status">
|
||||||
|
<template #label>
|
||||||
|
<Tooltip
|
||||||
|
titel="显示状态"
|
||||||
|
message="选择隐藏时,路由将不会出现在侧边栏,但仍然可以访问"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<el-radio-group v-model="menuForm.visible">
|
||||||
|
<el-radio-button key="true" :label="true">显示</el-radio-button>
|
||||||
|
<el-radio-button key="false" :label="false">隐藏</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<template v-if="menuForm.type === 2">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="菜单名称" prop="name">
|
<el-form-item label="缓存状态" prop="keepAlive">
|
||||||
<el-input v-model="menuForm.name" placeholder="请输入菜单名称" clearable />
|
<template #label>
|
||||||
</el-form-item>
|
<Tooltip
|
||||||
</el-col>
|
titel="缓存状态"
|
||||||
<template v-if="menuForm.type !== 3">
|
message="选择缓存时,则会被 `keep-alive` 缓存,需要匹配组件的 `name` 和路由地址保持一致"
|
||||||
<el-col :span="12">
|
/>
|
||||||
<el-form-item label="菜单图标">
|
</template>
|
||||||
<IconSelect v-model="menuForm.icon" clearable />
|
<el-radio-group v-model="menuForm.keepAlive">
|
||||||
</el-form-item>
|
<el-radio-button key="true" :label="true">缓存</el-radio-button>
|
||||||
</el-col>
|
<el-radio-button key="false" :label="false">不缓存</el-radio-button>
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="路由地址" prop="path">
|
|
||||||
<template #label>
|
|
||||||
<Tooltip
|
|
||||||
titel="路由地址"
|
|
||||||
message="访问的路由地址,如:`user`。如需外网地址时,则以 `http(s)://` 开头"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<el-input v-model="menuForm.path" placeholder="请输入路由地址" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</template>
|
|
||||||
<template v-if="menuForm.type === 2">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="路由地址" prop="component">
|
|
||||||
<el-input v-model="menuForm.component" placeholder="请输入组件地址" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</template>
|
|
||||||
<template v-if="menuForm.type !== 1">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="权限标识" prop="permission">
|
|
||||||
<template #label>
|
|
||||||
<Tooltip
|
|
||||||
titel="权限标识"
|
|
||||||
message="Controller 方法上的权限字符,如:@PreAuthorize(`@ss.hasPermission('system:user:list')`)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<el-input v-model="menuForm.permission" placeholder="请输入权限标识" clearable />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</template>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="显示排序" prop="sort">
|
|
||||||
<el-input-number
|
|
||||||
v-model="menuForm.sort"
|
|
||||||
controls-position="right"
|
|
||||||
:min="0"
|
|
||||||
clearable
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="菜单状态" prop="status">
|
|
||||||
<el-radio-group v-model="menuForm.status">
|
|
||||||
<el-radio-button
|
|
||||||
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.value"
|
|
||||||
>
|
|
||||||
{{ dict.label }}
|
|
||||||
</el-radio-button>
|
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<template v-if="menuForm.type !== 3">
|
</template>
|
||||||
<el-col :span="12">
|
</el-row>
|
||||||
<el-form-item label="显示状态" prop="status">
|
</el-form>
|
||||||
<template #label>
|
|
||||||
<Tooltip
|
|
||||||
titel="显示状态"
|
|
||||||
message="选择隐藏时,路由将不会出现在侧边栏,但仍然可以访问"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<el-radio-group v-model="menuForm.visible">
|
|
||||||
<el-radio-button key="true" :label="true">显示</el-radio-button>
|
|
||||||
<el-radio-button key="false" :label="false">隐藏</el-radio-button>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</template>
|
|
||||||
<template v-if="menuForm.type === 2">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="缓存状态" prop="keepAlive">
|
|
||||||
<template #label>
|
|
||||||
<Tooltip
|
|
||||||
titel="缓存状态"
|
|
||||||
message="选择缓存时,则会被 `keep-alive` 缓存,需要匹配组件的 `name` 和路由地址保持一致"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<el-radio-group v-model="menuForm.keepAlive">
|
|
||||||
<el-radio-button key="true" :label="true">缓存</el-radio-button>
|
|
||||||
<el-radio-button key="false" :label="false">不缓存</el-radio-button>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</template>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<!-- 按钮:保存 -->
|
<!-- 按钮:保存 -->
|
||||||
<XButton
|
<XButton
|
||||||
@ -247,7 +240,7 @@
|
|||||||
<!-- 按钮:关闭 -->
|
<!-- 按钮:关闭 -->
|
||||||
<XButton :loading="actionLoading" @click="dialogVisible = false" :title="t('dialog.close')" />
|
<XButton :loading="actionLoading" @click="dialogVisible = false" :title="t('dialog.close')" />
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// 全局相关的 import
|
// 全局相关的 import
|
||||||
|
@ -38,22 +38,20 @@
|
|||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<!-- 弹窗 -->
|
<!-- 弹窗 -->
|
||||||
<XModal id="noticeModel" v-model="dialogVisible" :title="dialogTitle">
|
<Dialog id="noticeModel" v-model="dialogVisible" :title="dialogTitle">
|
||||||
<template #default>
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<Form
|
||||||
<Form
|
ref="formRef"
|
||||||
ref="formRef"
|
v-if="['create', 'update'].includes(actionType)"
|
||||||
v-if="['create', 'update'].includes(actionType)"
|
:schema="allSchemas.formSchema"
|
||||||
:schema="allSchemas.formSchema"
|
:rules="rules"
|
||||||
:rules="rules"
|
/>
|
||||||
/>
|
<!-- 对话框(详情) -->
|
||||||
<!-- 对话框(详情) -->
|
<Descriptions
|
||||||
<Descriptions
|
v-if="actionType === 'detail'"
|
||||||
v-if="actionType === 'detail'"
|
:schema="allSchemas.detailSchema"
|
||||||
:schema="allSchemas.detailSchema"
|
:data="detailRef"
|
||||||
:data="detailRef"
|
/>
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<!-- 按钮:保存 -->
|
<!-- 按钮:保存 -->
|
||||||
<XButton
|
<XButton
|
||||||
@ -66,7 +64,7 @@
|
|||||||
<!-- 按钮:关闭 -->
|
<!-- 按钮:关闭 -->
|
||||||
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// 全局相关的 import
|
// 全局相关的 import
|
||||||
|
@ -48,23 +48,21 @@
|
|||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<!-- 弹窗 -->
|
<!-- 弹窗 -->
|
||||||
<XModal id="postModel" v-model="dialogVisible" :title="dialogTitle">
|
<Dialog id="postModel" v-model="dialogVisible" :title="dialogTitle">
|
||||||
<template #default>
|
<!-- 表单:添加/修改 -->
|
||||||
<!-- 表单:添加/修改 -->
|
<Form
|
||||||
<Form
|
ref="formRef"
|
||||||
ref="formRef"
|
v-if="['create', 'update'].includes(actionType)"
|
||||||
v-if="['create', 'update'].includes(actionType)"
|
:schema="allSchemas.formSchema"
|
||||||
:schema="allSchemas.formSchema"
|
:rules="rules"
|
||||||
:rules="rules"
|
/>
|
||||||
/>
|
<!-- 表单:详情 -->
|
||||||
<!-- 表单:详情 -->
|
<!-- TODO @星语:展示详情时,有点小丑,可额能得看看 -->
|
||||||
<!-- TODO @星语:展示详情时,有点小丑,可额能得看看 -->
|
<Descriptions
|
||||||
<Descriptions
|
v-if="actionType === 'detail'"
|
||||||
v-if="actionType === 'detail'"
|
:schema="allSchemas.detailSchema"
|
||||||
:schema="allSchemas.detailSchema"
|
:data="detailRef"
|
||||||
:data="detailRef"
|
/>
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<!-- 按钮:保存 -->
|
<!-- 按钮:保存 -->
|
||||||
<XButton
|
<XButton
|
||||||
@ -77,7 +75,7 @@
|
|||||||
<!-- 按钮:关闭 -->
|
<!-- 按钮:关闭 -->
|
||||||
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// 全局相关的 import
|
// 全局相关的 import
|
||||||
|
@ -25,23 +25,21 @@
|
|||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<!-- 弹窗 -->
|
<!-- 弹窗 -->
|
||||||
<XModal id="postModel" v-model="dialogVisible" :title="dialogTitle">
|
<Dialog id="postModel" v-model="dialogVisible" :title="dialogTitle">
|
||||||
<template #default>
|
<!-- 对话框(详情) -->
|
||||||
<!-- 对话框(详情) -->
|
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef">
|
||||||
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef">
|
<template #resultCode="{ row }">
|
||||||
<template #resultCode="{ row }">
|
<span>{{ row.resultCode === 0 ? '成功' : '失败' }}</span>
|
||||||
<span>{{ row.resultCode === 0 ? '成功' : '失败' }}</span>
|
</template>
|
||||||
</template>
|
<template #duration="{ row }">
|
||||||
<template #duration="{ row }">
|
<span>{{ row.duration + 'ms' }}</span>
|
||||||
<span>{{ row.duration + 'ms' }}</span>
|
</template>
|
||||||
</template>
|
</Descriptions>
|
||||||
</Descriptions>
|
|
||||||
</template>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<!-- 按钮:关闭 -->
|
<!-- 按钮:关闭 -->
|
||||||
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// 全局相关的 import
|
// 全局相关的 import
|
||||||
|
@ -45,22 +45,20 @@
|
|||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
<!-- 弹窗 -->
|
<!-- 弹窗 -->
|
||||||
<XModal id="postModel" v-model="dialogVisible" :title="dialogTitle">
|
<Dialog id="postModel" v-model="dialogVisible" :title="dialogTitle">
|
||||||
<template #default>
|
<!-- 表单:添加/修改 -->
|
||||||
<!-- 表单:添加/修改 -->
|
<Form
|
||||||
<Form
|
ref="formRef"
|
||||||
ref="formRef"
|
v-if="['create', 'update'].includes(actionType)"
|
||||||
v-if="['create', 'update'].includes(actionType)"
|
:schema="allSchemas.formSchema"
|
||||||
:schema="allSchemas.formSchema"
|
:rules="rules"
|
||||||
:rules="rules"
|
/>
|
||||||
/>
|
<!-- 表单:详情 -->
|
||||||
<!-- 表单:详情 -->
|
<Descriptions
|
||||||
<Descriptions
|
v-if="actionType === 'detail'"
|
||||||
v-if="actionType === 'detail'"
|
:schema="allSchemas.detailSchema"
|
||||||
:schema="allSchemas.detailSchema"
|
:data="detailRef"
|
||||||
:data="detailRef"
|
/>
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<!-- 按钮:保存 -->
|
<!-- 按钮:保存 -->
|
||||||
<XButton
|
<XButton
|
||||||
@ -73,7 +71,7 @@
|
|||||||
<!-- 按钮:关闭 -->
|
<!-- 按钮:关闭 -->
|
||||||
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// 全局相关的 import
|
// 全局相关的 import
|
||||||
|
Reference in New Issue
Block a user