fix: print Params
parent
4bc7645850
commit
efb4cf0c66
|
@ -52,13 +52,25 @@ export const useMessage = () => {
|
||||||
ElNotification.warning(content)
|
ElNotification.warning(content)
|
||||||
},
|
},
|
||||||
// 确认窗体
|
// 确认窗体
|
||||||
confirm(content: string, tip: string) {
|
confirm(content: string, tip?: string) {
|
||||||
return ElMessageBox.confirm(content, tip, {
|
return ElMessageBox.confirm(content, tip ? tip : t('common.confirmTitle'), {
|
||||||
confirmButtonText: t('common.ok'),
|
confirmButtonText: t('common.ok'),
|
||||||
cancelButtonText: t('common.cancel'),
|
cancelButtonText: t('common.cancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 删除窗体
|
||||||
|
delConfirm(content?: string, tip?: string) {
|
||||||
|
return ElMessageBox.confirm(
|
||||||
|
content ? content : t('common.delMessage'),
|
||||||
|
tip ? tip : t('common.confirmTitle'),
|
||||||
|
{
|
||||||
|
confirmButtonText: t('common.ok'),
|
||||||
|
cancelButtonText: t('common.cancel'),
|
||||||
|
type: 'warning'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
},
|
||||||
// 提交内容
|
// 提交内容
|
||||||
prompt(content: string, tip: string) {
|
prompt(content: string, tip: string) {
|
||||||
return ElMessageBox.prompt(content, tip, {
|
return ElMessageBox.prompt(content, tip, {
|
||||||
|
|
|
@ -18,7 +18,7 @@ export type VxeCrudSchema = Omit<VxeTableColumn, 'children'> & {
|
||||||
table?: CrudTableParams
|
table?: CrudTableParams
|
||||||
form?: CrudFormParams
|
form?: CrudFormParams
|
||||||
detail?: CrudDescriptionsParams
|
detail?: CrudDescriptionsParams
|
||||||
print?: boolean
|
print?: CrudPrintParams
|
||||||
children?: VxeCrudSchema[]
|
children?: VxeCrudSchema[]
|
||||||
dictType?: string
|
dictType?: string
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,11 @@ type CrudDescriptionsParams = {
|
||||||
show?: boolean
|
show?: boolean
|
||||||
} & Omit<DescriptionsSchema, 'field'>
|
} & Omit<DescriptionsSchema, 'field'>
|
||||||
|
|
||||||
|
type CrudPrintParams = {
|
||||||
|
// 是否显示表单项
|
||||||
|
show?: boolean
|
||||||
|
} & Omit<VxeTableDefines.ColumnInfo[], 'field'>
|
||||||
|
|
||||||
interface VxeAllSchemas {
|
interface VxeAllSchemas {
|
||||||
searchSchema: VxeFormItemProps[]
|
searchSchema: VxeFormItemProps[]
|
||||||
tableSchema: VxeGridPropTypes.Columns
|
tableSchema: VxeGridPropTypes.Columns
|
||||||
|
@ -233,7 +238,7 @@ const filterPrintSchema = (crudSchema: VxeCrudSchema[]): any[] => {
|
||||||
|
|
||||||
eachTree(crudSchema, (schemaItem: VxeCrudSchema) => {
|
eachTree(crudSchema, (schemaItem: VxeCrudSchema) => {
|
||||||
// 判断是否显示
|
// 判断是否显示
|
||||||
if (schemaItem?.detail?.show !== false) {
|
if (schemaItem?.print?.show !== false) {
|
||||||
const printSchemaItem = {
|
const printSchemaItem = {
|
||||||
field: schemaItem.field
|
field: schemaItem.field
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,6 @@ VXETable.setup({
|
||||||
grid: {
|
grid: {
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
refresh: true,
|
refresh: true,
|
||||||
import: true,
|
|
||||||
export: true,
|
export: true,
|
||||||
print: true,
|
print: true,
|
||||||
zoom: true,
|
zoom: true,
|
||||||
|
|
|
@ -79,24 +79,23 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
|
||||||
import { VxeFormEvents, VxeFormInstance, VxeFormItemProps, VxeGridInstance } from 'vxe-table'
|
|
||||||
import * as PostApi from '@/api/system/post'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
import { ContentWrap } from '@/components/ContentWrap'
|
import * as PostApi from '@/api/system/post'
|
||||||
import { PostVO } from '@/api/system/post/types'
|
import { PostVO } from '@/api/system/post/types'
|
||||||
import { rules, allSchemas } from './post.data'
|
import { rules, allSchemas } from './post.data'
|
||||||
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { useMessage } from '@/hooks/web/useMessage'
|
import { useMessage } from '@/hooks/web/useMessage'
|
||||||
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
||||||
|
import { VxeFormEvents, VxeFormInstance, VxeFormItemProps, VxeGridInstance } from 'vxe-table'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage()
|
const message = useMessage() // 消息弹窗
|
||||||
const xGrid = ref<VxeGridInstance>()
|
const xGrid = ref<VxeGridInstance>()
|
||||||
const xForm = ref<VxeFormInstance>()
|
const xForm = ref<VxeFormInstance>()
|
||||||
const dialogVisible = ref(false) // 是否显示弹出层
|
const dialogVisible = ref(false) // 是否显示弹出层
|
||||||
const dialogTitle = ref('edit') // 弹出层标题
|
const dialogTitle = ref('edit') // 弹出层标题
|
||||||
const actionType = ref('') // 操作按钮的类型
|
const actionType = ref('') // 操作按钮的类型
|
||||||
const actionLoading = ref(false) // 遮罩层
|
const actionLoading = ref(false) // 按钮Loading
|
||||||
|
|
||||||
const gridOptions = useVxeGrid(allSchemas, PostApi.getPostPageApi)
|
const gridOptions = useVxeGrid(allSchemas, PostApi.getPostPageApi)
|
||||||
const formData = ref<PostVO>()
|
const formData = ref<PostVO>()
|
||||||
|
@ -130,7 +129,7 @@ const handleUpdate = async (rowId: number) => {
|
||||||
// 删除操作
|
// 删除操作
|
||||||
const handleDelete = (rowId: number) => {
|
const handleDelete = (rowId: number) => {
|
||||||
message
|
message
|
||||||
.confirm(t('common.delMessage'), t('common.confirmTitle'))
|
.delConfirm()
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await PostApi.deletePostApi(rowId)
|
await PostApi.deletePostApi(rowId)
|
||||||
message.success(t('common.delSuccess'))
|
message.success(t('common.delSuccess'))
|
||||||
|
|
Loading…
Reference in New Issue