feat: use common-ui ContentWrap

This commit is contained in:
xingyu4j
2025-09-24 15:05:23 +08:00
parent 80b2e4fce4
commit b26f9b1380
36 changed files with 35 additions and 148 deletions

View File

@@ -4,12 +4,12 @@ import type { BpmProcessListenerApi } from '#/api/bpm/processListener';
import { reactive, ref } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { CommonStatusEnum, DICT_TYPE } from '@vben/constants';
import { Button, Modal, Pagination, Table } from 'ant-design-vue';
import { getProcessListenerPage } from '#/api/bpm/processListener';
import { ContentWrap } from '#/components/content-wrap';
import { DictTag } from '#/components/dict-tag';
/** BPM 流程 表单 */

View File

@@ -4,12 +4,12 @@ import type { BpmProcessExpressionApi } from '#/api/bpm/processExpression';
import { reactive, ref } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { CommonStatusEnum } from '@vben/constants';
import { Button, Modal, Pagination, Table, TableColumn } from 'ant-design-vue';
import { getProcessExpressionPage } from '#/api/bpm/processExpression';
import { ContentWrap } from '#/components/content-wrap';
/** BPM 流程 表单 */
defineOptions({ name: 'ProcessExpressionDialog' });

View File

@@ -1,49 +0,0 @@
<!--
参考自 https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/components/ContentWrap/src/ContentWrap.vue
保证和 yudao-ui-admin-vue3 功能的一致性
-->
<script lang="ts" setup>
import type { CSSProperties } from 'vue';
import { ShieldQuestion } from '@vben/icons';
import { Card, Tooltip } from 'ant-design-vue';
defineOptions({ name: 'ContentWrap' });
withDefaults(
defineProps<{
bodyStyle?: CSSProperties;
message?: string;
title?: string;
}>(),
{
bodyStyle: () => ({ padding: '10px' }),
title: '',
message: '',
},
);
</script>
<template>
<Card :body-style="bodyStyle" :title="title" class="mb-4">
<template v-if="title" #title>
<div class="flex items-center">
<span class="text-base font-bold">{{ title }}</span>
<Tooltip placement="right">
<template #title>
<div class="max-w-[200px]">{{ message }}</div>
</template>
<ShieldQuestion :size="14" class="ml-1" />
</Tooltip>
<div class="flex flex-grow pl-5">
<slot name="header"></slot>
</div>
</div>
</template>
<template #extra>
<slot name="extra"></slot>
</template>
<slot></slot>
</Card>
</template>

View File

@@ -1 +0,0 @@
export { default as ContentWrap } from './content-wrap.vue';

View File

@@ -5,6 +5,7 @@ import type { BpmModelApi } from '#/api/bpm/model';
import { inject, onBeforeUnmount, provide, ref, shallowRef, watch } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { BpmModelFormType } from '@vben/constants';
import { message } from 'ant-design-vue';
@@ -18,7 +19,6 @@ import {
import CustomContentPadProvider from '#/components/bpmn-process-designer/package/designer/plugins/content-pad';
// 自定义左侧菜单(修改 默认任务 为 用户任务)
import CustomPaletteProvider from '#/components/bpmn-process-designer/package/designer/plugins/palette';
import { ContentWrap } from '#/components/content-wrap';
defineOptions({ name: 'BpmModelEditor' });

View File

@@ -1,7 +1,8 @@
<script setup lang="ts">
import { ref } from 'vue';
import ContentWrap from '#/components/content-wrap/content-wrap.vue';
import { ContentWrap } from '@vben/common-ui';
import { SimpleProcessDesigner } from '#/components/simple-process-design';
defineOptions({ name: 'SimpleModelDesign' });
@@ -30,7 +31,7 @@ async function validateConfig() {
defineExpose({ validateConfig });
</script>
<template>
<ContentWrap :body-style="{ padding: '20px 16px' }">
<ContentWrap class="px-4 py-5">
<SimpleProcessDesigner
:model-form-id="modelFormId"
:model-name="modelName"

View File

@@ -4,8 +4,9 @@ import type { BpmOALeaveApi } from '#/api/bpm/oa/leave';
import { computed, onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import { ContentWrap } from '@vben/common-ui';
import { getLeave } from '#/api/bpm/oa/leave';
import { ContentWrap } from '#/components/content-wrap';
import { Description } from '#/components/description';
import { useDetailFormSchema } from './data';

View File

@@ -3,7 +3,7 @@ import type { Demo01ContactApi } from '#/api/infra/demo/demo01';
import { h, onMounted, reactive, ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
@@ -32,7 +32,6 @@ import {
exportDemo01Contact,
getDemo01ContactPage,
} from '#/api/infra/demo/demo01';
import { ContentWrap } from '#/components/content-wrap';
import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales';
import { getRangePickerDefaultProps } from '#/utils';

View File

@@ -3,7 +3,7 @@ import type { Demo02CategoryApi } from '#/api/infra/demo/demo02';
import { h, onMounted, reactive, ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { Download, Plus } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import {
@@ -21,7 +21,6 @@ import {
exportDemo02Category,
getDemo02CategoryList,
} from '#/api/infra/demo/demo02';
import { ContentWrap } from '#/components/content-wrap';
import { $t } from '#/locales';
import { getRangePickerDefaultProps } from '#/utils';

View File

@@ -3,7 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
import { h, onMounted, reactive, ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
@@ -33,7 +33,6 @@ import {
exportDemo03Student,
getDemo03StudentPage,
} from '#/api/infra/demo/demo03/erp';
import { ContentWrap } from '#/components/content-wrap';
import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales';
import { getRangePickerDefaultProps } from '#/utils';

View File

@@ -3,7 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
import { h, nextTick, onMounted, reactive, ref, watch } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { ContentWrap, useVbenModal } from '@vben/common-ui';
import { Plus, Trash2 } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import { cloneDeep, formatDateTime, isEmpty } from '@vben/utils';
@@ -23,7 +23,6 @@ import {
deleteDemo03CourseList,
getDemo03CoursePage,
} from '#/api/infra/demo/demo03/erp';
import { ContentWrap } from '#/components/content-wrap';
import { $t } from '#/locales';
import { getRangePickerDefaultProps } from '#/utils';

View File

@@ -3,7 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
import { h, nextTick, onMounted, reactive, ref, watch } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { ContentWrap, useVbenModal } from '@vben/common-ui';
import { Plus, Trash2 } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import { cloneDeep, formatDateTime, isEmpty } from '@vben/utils';
@@ -23,7 +23,6 @@ import {
deleteDemo03GradeList,
getDemo03GradePage,
} from '#/api/infra/demo/demo03/erp';
import { ContentWrap } from '#/components/content-wrap';
import { $t } from '#/locales';
import { getRangePickerDefaultProps } from '#/utils';

View File

@@ -3,7 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { h, onMounted, reactive, ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
@@ -33,7 +33,6 @@ import {
exportDemo03Student,
getDemo03StudentPage,
} from '#/api/infra/demo/demo03/normal';
import { ContentWrap } from '#/components/content-wrap';
import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales';
import { getRangePickerDefaultProps } from '#/utils';

View File

@@ -3,11 +3,11 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { nextTick, ref, watch } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { formatDateTime } from '@vben/utils';
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
import { getDemo03CourseListByStudentId } from '#/api/infra/demo/demo03/normal';
import { ContentWrap } from '#/components/content-wrap';
const props = defineProps<{
studentId?: number; // 学生编号(主表的关联字段)

View File

@@ -3,6 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { nextTick, ref, watch } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { formatDateTime } from '@vben/utils';
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';

View File

@@ -3,7 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { h, onMounted, reactive, ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
@@ -32,7 +32,6 @@ import {
exportDemo03Student,
getDemo03StudentPage,
} from '#/api/infra/demo/demo03/normal';
import { ContentWrap } from '#/components/content-wrap';
import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales';
import { getRangePickerDefaultProps } from '#/utils';

View File

@@ -4,14 +4,13 @@ import type { MallSpuApi } from '#/api/mall/product/spu';
import { onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import { Page } from '@vben/common-ui';
import { ContentWrap, Page } from '@vben/common-ui';
import { convertToInteger, formatToFraction } from '@vben/utils';
import { Button, Tabs } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import { createSpu, getSpu, updateSpu } from '#/api/mall/product/spu';
import { ContentWrap } from '#/components/content-wrap';
import {
useDeliveryFormSchema,

View File

@@ -1,53 +0,0 @@
<!--
参考自 https://github.com/yudaocode/yudao-ui-admin-vue3/blob/master/src/components/ContentWrap/src/ContentWrap.vue
保证和 yudao-ui-admin-vue3 功能的一致性
-->
<script lang="ts" setup>
import type { CSSProperties } from 'vue';
import { ShieldQuestion } from '@vben/icons';
import { ElCard, ElTooltip } from 'element-plus';
defineOptions({ name: 'ContentWrap' });
withDefaults(
defineProps<{
bodyStyle?: CSSProperties;
message?: string;
title?: string;
}>(),
{
bodyStyle: () => ({ padding: '10px' }),
title: '',
message: '',
},
);
</script>
<template>
<ElCard :body-style="bodyStyle" :header="title" class="mb-4">
<template v-if="title" #header>
<div class="flex items-center justify-between">
<div class="flex items-center">
<span class="text-4 font-[700]">{{ title }}</span>
<ElTooltip placement="right">
<template #content>
<div class="max-w-[200px]">{{ message }}</div>
</template>
<ShieldQuestion :size="14" class="ml-5px" />
</ElTooltip>
<div class="pl-20px flex flex-grow">
<slot name="header"></slot>
</div>
</div>
<div>
<slot name="extra"></slot>
</div>
</div>
</template>
<template #default>
<slot></slot>
</template>
</ElCard>
</template>

View File

@@ -1 +0,0 @@
export { default as ContentWrap } from './content-wrap.vue';

View File

@@ -3,7 +3,7 @@ import type { Demo01ContactApi } from '#/api/infra/demo/demo01';
import { h, onMounted, reactive, ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
@@ -35,7 +35,6 @@ import {
exportDemo01Contact,
getDemo01ContactPage,
} from '#/api/infra/demo/demo01';
import { ContentWrap } from '#/components/content-wrap';
import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales';

View File

@@ -3,7 +3,7 @@ import type { Demo02CategoryApi } from '#/api/infra/demo/demo02';
import { h, onMounted, reactive, ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { Download, Plus } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import {
@@ -29,7 +29,6 @@ import {
exportDemo02Category,
getDemo02CategoryList,
} from '#/api/infra/demo/demo02';
import { ContentWrap } from '#/components/content-wrap';
import { $t } from '#/locales';
import Demo02CategoryForm from './modules/form.vue';

View File

@@ -3,7 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
import { h, onMounted, reactive, ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
@@ -37,7 +37,6 @@ import {
exportDemo03Student,
getDemo03StudentPage,
} from '#/api/infra/demo/demo03/erp';
import { ContentWrap } from '#/components/content-wrap';
import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales';

View File

@@ -3,7 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
import { h, nextTick, onMounted, reactive, ref, watch } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { ContentWrap, useVbenModal } from '@vben/common-ui';
import { Plus, Trash2 } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import { cloneDeep, formatDateTime, isEmpty } from '@vben/utils';
@@ -25,7 +25,6 @@ import {
deleteDemo03CourseList,
getDemo03CoursePage,
} from '#/api/infra/demo/demo03/erp';
import { ContentWrap } from '#/components/content-wrap';
import { $t } from '#/locales';
import Demo03CourseForm from './demo03-course-form.vue';

View File

@@ -3,7 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
import { h, nextTick, onMounted, reactive, ref, watch } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { ContentWrap, useVbenModal } from '@vben/common-ui';
import { Plus, Trash2 } from '@vben/icons';
import { useTableToolbar, VbenVxeTableToolbar } from '@vben/plugins/vxe-table';
import { cloneDeep, formatDateTime, isEmpty } from '@vben/utils';
@@ -25,7 +25,6 @@ import {
deleteDemo03GradeList,
getDemo03GradePage,
} from '#/api/infra/demo/demo03/erp';
import { ContentWrap } from '#/components/content-wrap';
import { $t } from '#/locales';
import Demo03GradeForm from './demo03-grade-form.vue';

View File

@@ -3,7 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/inner';
import { h, onMounted, reactive, ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
@@ -37,7 +37,6 @@ import {
exportDemo03Student,
getDemo03StudentPage,
} from '#/api/infra/demo/demo03/inner';
import { ContentWrap } from '#/components/content-wrap';
import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales';

View File

@@ -3,11 +3,11 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/inner';
import { nextTick, ref, watch } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { formatDateTime } from '@vben/utils';
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
import { getDemo03CourseListByStudentId } from '#/api/infra/demo/demo03/inner';
import { ContentWrap } from '#/components/content-wrap';
const props = defineProps<{
studentId?: number; // 学生编号(主表的关联字段)

View File

@@ -3,11 +3,11 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/inner';
import { nextTick, ref, watch } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { formatDateTime } from '@vben/utils';
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
import { getDemo03GradeByStudentId } from '#/api/infra/demo/demo03/inner';
import { ContentWrap } from '#/components/content-wrap';
const props = defineProps<{
studentId?: number; // 学生编号(主表的关联字段)

View File

@@ -3,7 +3,7 @@ import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { h, onMounted, reactive, ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { Download, Plus, Trash2 } from '@vben/icons';
@@ -35,7 +35,6 @@ import {
exportDemo03Student,
getDemo03StudentPage,
} from '#/api/infra/demo/demo03/normal';
import { ContentWrap } from '#/components/content-wrap';
import { DictTag } from '#/components/dict-tag';
import { $t } from '#/locales';

View File

@@ -4,6 +4,7 @@ import type { MallSpuApi } from '#/api/mall/product/spu';
import { onMounted, ref } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { handleTree } from '@vben/utils';
import {
@@ -24,7 +25,6 @@ import {
import * as ProductCategoryApi from '#/api/mall/product/category';
import * as ProductSpuApi from '#/api/mall/product/spu';
/**
* 商品表格选择对话框
* 1. 单选模式:

View File

@@ -3,6 +3,7 @@ import type { MallCombinationActivityApi } from '#/api/mall/promotion/combinatio
import { onMounted, ref } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import {

View File

@@ -3,6 +3,7 @@ import type { MallCouponTemplateApi } from '#/api/mall/promotion/coupon/couponTe
import { reactive, ref } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { CouponTemplateTakeTypeEnum, DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';

View File

@@ -3,6 +3,7 @@ import type { MallPointActivityApi } from '#/api/mall/promotion/point';
import { computed, ref } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import { dateFormatter, fenToYuanFormat } from '@vben/utils';

View File

@@ -3,6 +3,7 @@ import type { MallSeckillActivityApi } from '#/api/mall/promotion/seckill/seckil
import { onMounted, ref } from 'vue';
import { ContentWrap } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictOptions } from '@vben/hooks';
import {

View File

@@ -5,7 +5,7 @@ import type { MallOrderApi } from '#/api/mall/trade/order';
import { onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { confirm, Page } from '@vben/common-ui';
import { confirm, ContentWrap, Page } from '@vben/common-ui';
import { DICT_TYPE } from '@vben/constants';
import { getDictLabel, getDictObj } from '@vben/hooks';
import { $t } from '@vben/locales';
@@ -21,7 +21,6 @@ import {
} from 'element-plus';
import * as AfterSaleApi from '#/api/mall/trade/afterSale/index';
import ContentWrap from '#/components/content-wrap/content-wrap.vue';
import { DictTag } from '#/components/dict-tag';
import UpdateAuditReasonForm from './disagree-form.vue';

View File

@@ -6,7 +6,7 @@ import type { MallOrderApi } from '#/api/mall/trade/order';
import { onMounted, ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { confirm, Page, useVbenModal } from '@vben/common-ui';
import { confirm, ContentWrap, Page, useVbenModal } from '@vben/common-ui';
import {
DeliveryTypeEnum,
DICT_TYPE,
@@ -26,7 +26,6 @@ import {
import * as DeliveryExpressApi from '#/api/mall/trade/delivery/express';
import * as DeliveryPickUpStoreApi from '#/api/mall/trade/delivery/pickUpStore';
import * as TradeOrderApi from '#/api/mall/trade/order';
import ContentWrap from '#/components/content-wrap/content-wrap.vue';
import { DictTag } from '#/components/dict-tag';
import OrderDeliveryForm from './delevery-form.vue';

View File

@@ -1,6 +1,7 @@
export * from './api-component';
export * from './captcha';
export * from './col-page';
export * from './content-wrap';
export * from './count-to';
export * from './doc-alert';
export * from './ellipsis-text';