fix(workspace): 收敛 MP、ERP 和 demo 类型兼容问题

pull/365/head
XuZhiqiang 2026-06-19 10:52:59 +08:00
parent e1731f5394
commit 1e4436561c
47 changed files with 268 additions and 116 deletions

View File

@ -3,6 +3,19 @@ import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace MpFreePublishApi {
/** 图文文章内容 */
export interface FreePublishArticle {
title?: string;
thumbUrl?: string;
picUrl?: string;
url?: string;
}
/** 图文内容 */
export interface FreePublishContent {
newsItem?: FreePublishArticle[];
}
/** 自由发布文章信息 */
export interface FreePublish {
id?: number;
@ -12,7 +25,7 @@ export namespace MpFreePublishApi {
title: string;
author: string;
digest: string;
content: string;
content?: FreePublishContent;
thumbUrl: string;
status: number;
publishTime?: Date;

View File

@ -12,10 +12,6 @@ import TimeSummaryChart from './modules/time-summary-chart.vue';
defineOptions({ name: 'ErpHome' });
const loading = ref(false); //
/** 图表组件引用 */
const saleChartRef = ref();
const purchaseChartRef = ref();
</script>
<template>
@ -36,15 +32,11 @@ const purchaseChartRef = ref();
<Row :gutter="16">
<!-- 销售统计 -->
<Col :md="12" :sm="12" :xs="24">
<TimeSummaryChart ref="saleChartRef" title="销售统计" type="sale" />
<TimeSummaryChart title="销售统计" type="sale" />
</Col>
<!-- 采购统计 -->
<Col :md="12" :sm="12" :xs="24">
<TimeSummaryChart
ref="purchaseChartRef"
title="采购统计"
type="purchase"
/>
<TimeSummaryChart title="采购统计" type="purchase" />
</Col>
</Row>
</div>

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { EchartsUIType } from '@vben/plugins/echarts';
import type { EChartsOption, EchartsUIType } from '@vben/plugins/echarts';
import type { ErpPurchaseStatisticsApi } from '#/api/erp/statistics/purchase';
import type { ErpSaleStatisticsApi } from '#/api/erp/statistics/sale';
@ -49,7 +49,7 @@ const chartRef = ref<EchartsUIType>();
const { renderEcharts } = useEcharts(chartRef);
/** 折线图配置 */
const lineChartOptions: echarts.EChartsOption = {
const lineChartOptions: EChartsOption = {
grid: {
left: 20,
right: 20,

View File

@ -53,7 +53,8 @@ watch(
/** 提供获取表格数据的方法供父组件调用 */
defineExpose({
getData: (): InfraCodegenApi.CodegenColumn[] => gridApi.grid.getData(),
getData: (): InfraCodegenApi.CodegenColumn[] =>
gridApi.grid.getData() as InfraCodegenApi.CodegenColumn[],
});
/** 初始化 */

View File

@ -1,4 +1,5 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/inner';
import { nextTick, watch } from 'vue';
@ -34,7 +35,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
toolbarConfig: {
enabled: false,
},
},
} as VxeTableGridOptions<Demo03StudentApi.Demo03Course>,
});
/** 添加学生课程 */

View File

@ -1,4 +1,5 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { nextTick, watch } from 'vue';
@ -33,7 +34,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
toolbarConfig: {
enabled: false,
},
},
} as VxeTableGridOptions<Demo03StudentApi.Demo03Course>,
});
/** 添加学生课程 */

View File

@ -153,6 +153,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -213,7 +219,7 @@ onMounted(() => {
<ContentWrap title="示例联系人">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -249,7 +255,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"

View File

@ -119,6 +119,12 @@ function toggleExpand() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -169,7 +175,7 @@ onMounted(() => {
<ContentWrap title="示例分类">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button @click="toggleExpand" class="mr-2">
@ -197,7 +203,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
:tree-config="{
parentField: 'parentId',

View File

@ -164,6 +164,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -224,7 +230,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -260,7 +266,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
@cell-click="onCellClick"
:row-config="{

View File

@ -155,6 +155,12 @@ watch(
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -213,7 +219,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -239,7 +245,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"

View File

@ -155,6 +155,12 @@ watch(
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -213,7 +219,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -239,7 +245,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"

View File

@ -157,6 +157,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -217,7 +223,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -253,7 +259,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"

View File

@ -154,6 +154,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -214,7 +220,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -250,7 +256,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"

View File

@ -92,7 +92,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
refresh: true,
search: true,
},
} as VxeTableGridOptions<FreePublish.FreePublish>,
} as VxeTableGridOptions<MpFreePublishApi.FreePublish>,
});
</script>

View File

@ -3,6 +3,19 @@ import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace MpFreePublishApi {
/** 图文文章内容 */
export interface FreePublishArticle {
title?: string;
thumbUrl?: string;
picUrl?: string;
url?: string;
}
/** 图文内容 */
export interface FreePublishContent {
newsItem?: FreePublishArticle[];
}
/** 自由发布文章信息 */
export interface FreePublish {
id?: number;
@ -12,7 +25,7 @@ export namespace MpFreePublishApi {
title: string;
author: string;
digest: string;
content: string;
content?: FreePublishContent;
thumbUrl: string;
status: number;
publishTime?: Date;

View File

@ -12,10 +12,6 @@ import TimeSummaryChart from './modules/time-summary-chart.vue';
defineOptions({ name: 'ErpHome' });
const loading = ref(false); //
/** 图表组件引用 */
const saleChartRef = ref();
const purchaseChartRef = ref();
</script>
<template>
@ -36,15 +32,11 @@ const purchaseChartRef = ref();
<Row :gutter="16">
<!-- 销售统计 -->
<Col :md="12" :sm="12" :xs="24">
<TimeSummaryChart ref="saleChartRef" title="销售统计" type="sale" />
<TimeSummaryChart title="销售统计" type="sale" />
</Col>
<!-- 采购统计 -->
<Col :md="12" :sm="12" :xs="24">
<TimeSummaryChart
ref="purchaseChartRef"
title="采购统计"
type="purchase"
/>
<TimeSummaryChart title="采购统计" type="purchase" />
</Col>
</Row>
</div>

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { EchartsUIType } from '@vben/plugins/echarts';
import type { EChartsOption, EchartsUIType } from '@vben/plugins/echarts';
import type { ErpPurchaseStatisticsApi } from '#/api/erp/statistics/purchase';
import type { ErpSaleStatisticsApi } from '#/api/erp/statistics/sale';
@ -49,7 +49,7 @@ const chartRef = ref<EchartsUIType>();
const { renderEcharts } = useEcharts(chartRef);
/** 折线图配置 */
const lineChartOptions: echarts.EChartsOption = {
const lineChartOptions: EChartsOption = {
grid: {
left: 20,
right: 20,

View File

@ -53,7 +53,8 @@ watch(
/** 提供获取表格数据的方法供父组件调用 */
defineExpose({
getData: (): InfraCodegenApi.CodegenColumn[] => gridApi.grid.getData(),
getData: (): InfraCodegenApi.CodegenColumn[] =>
gridApi.grid.getData() as InfraCodegenApi.CodegenColumn[],
});
/** 初始化 */

View File

@ -1,4 +1,5 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/inner';
import { nextTick, watch } from 'vue';
@ -34,7 +35,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
toolbarConfig: {
enabled: false,
},
},
} as VxeTableGridOptions<Demo03StudentApi.Demo03Course>,
});
/** 添加学生课程 */

View File

@ -1,4 +1,5 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { nextTick, watch } from 'vue';
@ -33,7 +34,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
toolbarConfig: {
enabled: false,
},
},
} as VxeTableGridOptions<Demo03StudentApi.Demo03Course>,
});
/** 添加学生课程 */

View File

@ -154,6 +154,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -208,7 +214,7 @@ onMounted(() => {
<ContentWrap title="示例联系人">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -244,7 +250,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"

View File

@ -126,6 +126,12 @@ function toggleExpand() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -176,7 +182,7 @@ onMounted(() => {
<ContentWrap title="示例分类">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button @click="toggleExpand" class="mr-2">
@ -204,7 +210,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
:tree-config="{
parentField: 'parentId',

View File

@ -165,6 +165,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -219,7 +225,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -255,7 +261,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
@cell-click="onCellClick"
:row-config="{

View File

@ -156,6 +156,12 @@ watch(
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -214,7 +220,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -240,7 +246,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"

View File

@ -156,6 +156,12 @@ watch(
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -214,7 +220,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -240,7 +246,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"

View File

@ -158,6 +158,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -212,7 +218,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -248,7 +254,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"

View File

@ -155,6 +155,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -209,7 +215,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<Button
@ -245,7 +251,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"

View File

@ -92,7 +92,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
refresh: true,
search: true,
},
} as VxeTableGridOptions<FreePublish.FreePublish>,
} as VxeTableGridOptions<MpFreePublishApi.FreePublish>,
});
</script>

View File

@ -3,6 +3,19 @@ import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace MpFreePublishApi {
/** 图文文章内容 */
export interface FreePublishArticle {
title?: string;
thumbUrl?: string;
picUrl?: string;
url?: string;
}
/** 图文内容 */
export interface FreePublishContent {
newsItem?: FreePublishArticle[];
}
/** 自由发布文章信息 */
export interface FreePublish {
id?: number;
@ -12,7 +25,7 @@ export namespace MpFreePublishApi {
title: string;
author: string;
digest: string;
content: string;
content?: FreePublishContent;
thumbUrl: string;
status: number;
publishTime?: Date;

View File

@ -12,12 +12,6 @@ import TimeSummaryChart from './modules/time-summary-chart.vue';
defineOptions({ name: 'ErpHome' });
const loading = ref(false); //
/** 图表组件引用 */
// @ts-expect-error unused
const saleChartRef = ref();
// @ts-expect-error unused
const purchaseChartRef = ref();
</script>
<template>
@ -37,15 +31,11 @@ const purchaseChartRef = ref();
<ElRow :gutter="16">
<!-- 销售统计 -->
<ElCol :md="12" :sm="12" :xs="24">
<TimeSummaryChart ref="saleChartRef" title="销售统计" type="sale" />
<TimeSummaryChart title="销售统计" type="sale" />
</ElCol>
<!-- 采购统计 -->
<ElCol :md="12" :sm="12" :xs="24">
<TimeSummaryChart
ref="purchaseChartRef"
title="采购统计"
type="purchase"
/>
<TimeSummaryChart title="采购统计" type="purchase" />
</ElCol>
</ElRow>
</div>

View File

@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { EchartsUIType } from '@vben/plugins/echarts';
import type { EChartsOption, EchartsUIType } from '@vben/plugins/echarts';
import type { ErpPurchaseStatisticsApi } from '#/api/erp/statistics/purchase';
import type { ErpSaleStatisticsApi } from '#/api/erp/statistics/sale';
@ -49,7 +49,7 @@ const chartRef = ref<EchartsUIType>();
const { renderEcharts } = useEcharts(chartRef);
/** 折线图配置 */
const lineChartOptions: echarts.EChartsOption = {
const lineChartOptions: EChartsOption = {
grid: {
left: 20,
right: 20,

View File

@ -53,7 +53,8 @@ watch(
/** 提供获取表格数据的方法供父组件调用 */
defineExpose({
getData: (): InfraCodegenApi.CodegenColumn[] => gridApi.grid.getData(),
getData: (): InfraCodegenApi.CodegenColumn[] =>
gridApi.grid.getData() as InfraCodegenApi.CodegenColumn[],
});
/** 初始化 */

View File

@ -1,4 +1,5 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/inner';
import { nextTick, watch } from 'vue';
@ -34,7 +35,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
toolbarConfig: {
enabled: false,
},
},
} as VxeTableGridOptions<Demo03StudentApi.Demo03Course>,
});
/** 添加学生课程 */

View File

@ -1,4 +1,5 @@
<script lang="ts" setup>
import type { VxeTableGridOptions } from '#/adapter/vxe-table';
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
import { nextTick, watch } from 'vue';
@ -33,7 +34,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
toolbarConfig: {
enabled: false,
},
},
} as VxeTableGridOptions<Demo03StudentApi.Demo03Course>,
});
/** 添加学生课程 */

View File

@ -148,6 +148,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -211,7 +217,7 @@ onMounted(() => {
<ContentWrap title="示例联系人">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<ElButton
@ -246,7 +252,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"
@ -279,7 +285,7 @@ onMounted(() => {
size="small"
type="primary"
link
@click="handleEdit(row as any)"
@click="handleEdit(row)"
v-access:code="['infra:demo01-contact:update']"
>
{{ $t('ui.actionTitle.edit') }}
@ -289,7 +295,7 @@ onMounted(() => {
type="danger"
link
class="ml-2"
@click="handleDelete(row as any)"
@click="handleDelete(row)"
v-access:code="['infra:demo01-contact:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@ -123,6 +123,12 @@ function toggleExpand() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -177,7 +183,7 @@ onMounted(() => {
<ContentWrap title="示例分类">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<ElButton @click="toggleExpand" class="mr-2">
@ -205,7 +211,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
:tree-config="{
parentField: 'parentId',
@ -231,7 +237,7 @@ onMounted(() => {
size="small"
type="primary"
link
@click="handleAppend(row as any)"
@click="handleAppend(row)"
v-access:code="['infra:demo02-category:create']"
>
新增下级
@ -240,7 +246,7 @@ onMounted(() => {
size="small"
type="primary"
link
@click="handleEdit(row as any)"
@click="handleEdit(row)"
v-access:code="['infra:demo02-category:update']"
>
{{ $t('ui.actionTitle.edit') }}
@ -251,7 +257,7 @@ onMounted(() => {
link
class="ml-2"
:disabled="!isEmpty(row?.children)"
@click="handleDelete(row as any)"
@click="handleDelete(row)"
v-access:code="['infra:demo02-category:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@ -125,10 +125,10 @@ const [Modal, modalApi] = useVbenModal({
:data="demo02CategoryTree"
:props="{
label: 'name',
value: 'id',
children: 'children',
}"
check-strictly
node-key="id"
default-expand-all
placeholder="请选择父级编号"
/>

View File

@ -160,6 +160,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -223,7 +229,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<ElButton
@ -258,7 +264,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
@cell-click="onCellClick"
:row-config="{
@ -296,7 +302,7 @@ onMounted(() => {
size="small"
type="primary"
link
@click="handleEdit(row as any)"
@click="handleEdit(row)"
v-access:code="['infra:demo03-student:update']"
>
{{ $t('ui.actionTitle.edit') }}
@ -306,7 +312,7 @@ onMounted(() => {
type="danger"
link
class="ml-2"
@click="handleDelete(row as any)"
@click="handleDelete(row)"
v-access:code="['infra:demo03-student:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@ -149,6 +149,12 @@ watch(
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -211,7 +217,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<ElButton
@ -236,7 +242,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"
@ -259,7 +265,7 @@ onMounted(() => {
size="small"
type="primary"
link
@click="handleEdit(row as any)"
@click="handleEdit(row)"
v-access:code="['infra:demo03-student:update']"
>
{{ $t('ui.actionTitle.edit') }}
@ -269,7 +275,7 @@ onMounted(() => {
type="danger"
link
class="ml-2"
@click="handleDelete(row as any)"
@click="handleDelete(row)"
v-access:code="['infra:demo03-student:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@ -149,6 +149,12 @@ watch(
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -211,7 +217,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<ElButton
@ -236,7 +242,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"
@ -259,7 +265,7 @@ onMounted(() => {
size="small"
type="primary"
link
@click="handleEdit(row as any)"
@click="handleEdit(row)"
v-access:code="['infra:demo03-student:update']"
>
{{ $t('ui.actionTitle.edit') }}
@ -269,7 +275,7 @@ onMounted(() => {
type="danger"
link
class="ml-2"
@click="handleDelete(row as any)"
@click="handleDelete(row)"
v-access:code="['infra:demo03-student:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@ -118,7 +118,7 @@ const [Modal, modalApi] = useVbenModal({
<ElRadioGroup v-model="formData.sex">
<ElRadio
v-for="dict in getDictOptions(DICT_TYPE.SYSTEM_USER_SEX, 'number')"
:key="dict.value"
:key="String(dict.value)"
:label="dict.value"
>
{{ dict.label }}

View File

@ -156,6 +156,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -219,7 +225,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<ElButton
@ -254,7 +260,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"
@ -300,7 +306,7 @@ onMounted(() => {
size="small"
type="primary"
link
@click="handleEdit(row as any)"
@click="handleEdit(row)"
v-access:code="['infra:demo03-student:update']"
>
{{ $t('ui.actionTitle.edit') }}
@ -310,7 +316,7 @@ onMounted(() => {
type="danger"
link
class="ml-2"
@click="handleDelete(row as any)"
@click="handleDelete(row)"
v-access:code="['infra:demo03-student:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@ -73,7 +73,7 @@ watch(
size="small"
type="danger"
link
@click="onDelete(row as any)"
@click="onDelete(row)"
v-access:code="['infra:demo03-student:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@ -149,6 +149,12 @@ async function handleExport() {
/** 初始化 */
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
function setTableToolbarRef(el: any) {
tableToolbarRef.value = el;
}
function setTableRef(el: any) {
tableRef.value = el;
}
onMounted(() => {
getList();
});
@ -212,7 +218,7 @@ onMounted(() => {
<ContentWrap title="学生">
<template #extra>
<VbenVxeTableToolbar
ref="tableToolbarRef"
:ref="setTableToolbarRef"
v-model:hidden-search="hiddenSearchBar"
>
<ElButton
@ -247,7 +253,7 @@ onMounted(() => {
</VbenVxeTableToolbar>
</template>
<VxeTable
ref="tableRef"
:ref="setTableRef"
:data="list"
show-overflow
:loading="loading"
@ -279,7 +285,7 @@ onMounted(() => {
size="small"
type="primary"
link
@click="handleEdit(row as any)"
@click="handleEdit(row)"
v-access:code="['infra:demo03-student:update']"
>
{{ $t('ui.actionTitle.edit') }}
@ -289,7 +295,7 @@ onMounted(() => {
type="danger"
link
class="ml-2"
@click="handleDelete(row as any)"
@click="handleDelete(row)"
v-access:code="['infra:demo03-student:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@ -73,7 +73,7 @@ watch(
size="small"
type="danger"
link
@click="handleDelete(row as any)"
@click="handleDelete(row)"
v-access:code="['infra:demo03-student:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@ -113,7 +113,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
v-for="(item, index) in row.content.newsItem"
:key="index"
:src="item.picUrl || item.thumbUrl"
:preview-src-list="[item.picUrl || item.thumbUrl]"
:preview-src-list="[item.picUrl || item.thumbUrl || '']"
class="h-36 !w-[300px] rounded object-cover"
:alt="`文章 ${index + 1} 封面图`"
/>

View File

@ -89,7 +89,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
rowConfig: {
keyField: 'id',
isHover: true,
height: type.value === UploadType.Image ? 220 : 'auto',
},
cellConfig: {
height: type.value === UploadType.Image ? 220 : undefined,
},
toolbarConfig: {
refresh: true,
@ -106,7 +108,9 @@ async function onTabChange() {
rowConfig: {
keyField: 'id',
isHover: true,
height: type.value === UploadType.Image ? 220 : 'auto',
},
cellConfig: {
height: type.value === UploadType.Image ? 220 : undefined,
},
});
await gridApi.reload();