feat:【ele/antd】【erp】优化详情界面,隐藏“操作”列
This commit is contained in:
@@ -170,7 +170,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -208,6 +210,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -234,7 +234,6 @@ defineExpose({ validate });
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -170,7 +170,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -208,6 +210,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -234,7 +234,6 @@ defineExpose({ validate });
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(
|
export function useFormItemColumns(
|
||||||
formData?: any[],
|
formData?: any[],
|
||||||
|
disabled?: boolean,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
@@ -295,6 +296,7 @@ export function useFormItemColumns(
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(tableData.value),
|
columns: useFormItemColumns(tableData.value, props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -95,7 +95,7 @@ watch(
|
|||||||
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
||||||
await gridApi.grid.reloadData(tableData.value);
|
await gridApi.grid.reloadData(tableData.value);
|
||||||
// 更新表格列配置(目的:原数量、已入库动态列)
|
// 更新表格列配置(目的:原数量、已入库动态列)
|
||||||
const columns = useFormItemColumns(tableData.value);
|
const columns = useFormItemColumns(tableData.value, props.disabled);
|
||||||
await gridApi.grid.reloadColumn(columns || []);
|
await gridApi.grid.reloadColumn(columns || []);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -258,7 +258,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -160,7 +160,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -237,6 +239,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -270,7 +270,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(
|
export function useFormItemColumns(
|
||||||
formData?: any[],
|
formData?: any[],
|
||||||
|
disabled?: boolean,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
@@ -295,6 +296,7 @@ export function useFormItemColumns(
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(tableData.value),
|
columns: useFormItemColumns(tableData.value, props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -95,7 +95,7 @@ watch(
|
|||||||
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
||||||
await gridApi.grid.reloadData(tableData.value);
|
await gridApi.grid.reloadData(tableData.value);
|
||||||
// 更新表格列配置(目的:已入库、已退货动态列)
|
// 更新表格列配置(目的:已入库、已退货动态列)
|
||||||
const columns = useFormItemColumns(tableData.value);
|
const columns = useFormItemColumns(tableData.value, props.disabled);
|
||||||
await gridApi.grid.reloadColumn(columns || []);
|
await gridApi.grid.reloadColumn(columns || []);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -260,7 +260,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -173,7 +173,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -251,6 +253,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -270,7 +270,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(
|
export function useFormItemColumns(
|
||||||
formData?: any[],
|
formData?: any[],
|
||||||
|
disabled?: boolean,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
@@ -316,6 +317,7 @@ export function useFormItemColumns(
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(tableData.value, props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -95,7 +95,7 @@ watch(
|
|||||||
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
||||||
await gridApi.grid.reloadData(tableData.value);
|
await gridApi.grid.reloadData(tableData.value);
|
||||||
// 更新表格列配置(目的:原数量、已出库动态列)
|
// 更新表格列配置(目的:原数量、已出库动态列)
|
||||||
const columns = useFormItemColumns(tableData.value);
|
const columns = useFormItemColumns(tableData.value, props.disabled);
|
||||||
await gridApi.grid.reloadColumn(columns || []);
|
await gridApi.grid.reloadColumn(columns || []);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -258,7 +258,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(
|
export function useFormItemColumns(
|
||||||
formData?: any[],
|
formData?: any[],
|
||||||
|
disabled?: boolean,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
@@ -309,6 +310,7 @@ export function useFormItemColumns(
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(tableData.value),
|
columns: useFormItemColumns(tableData.value, props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -95,7 +95,7 @@ watch(
|
|||||||
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
||||||
await gridApi.grid.reloadData(tableData.value);
|
await gridApi.grid.reloadData(tableData.value);
|
||||||
// 更新表格列配置(目的:已出库、已出库动态列)
|
// 更新表格列配置(目的:已出库、已出库动态列)
|
||||||
const columns = useFormItemColumns(tableData.value);
|
const columns = useFormItemColumns(tableData.value, props.disabled);
|
||||||
await gridApi.grid.reloadColumn(columns || []);
|
await gridApi.grid.reloadColumn(columns || []);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -258,7 +258,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -85,7 +85,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -156,6 +158,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -265,7 +265,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -163,6 +165,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -254,7 +254,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -85,7 +85,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -154,6 +156,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -275,7 +275,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -102,7 +102,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -165,6 +167,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -252,7 +252,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -176,7 +176,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -214,6 +216,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -236,7 +236,6 @@ defineExpose({ validate });
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -176,7 +176,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -214,6 +216,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -236,7 +236,6 @@ defineExpose({ validate });
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -207,6 +207,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(
|
export function useFormItemColumns(
|
||||||
formData?: any[],
|
formData?: any[],
|
||||||
|
disabled?: boolean,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
@@ -306,6 +307,7 @@ export function useFormItemColumns(
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(tableData.value),
|
columns: useFormItemColumns(tableData.value, props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -95,7 +95,7 @@ watch(
|
|||||||
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
||||||
await gridApi.grid.reloadData(tableData.value);
|
await gridApi.grid.reloadData(tableData.value);
|
||||||
// 更新表格列配置(目的:原数量、已入库动态列)
|
// 更新表格列配置(目的:原数量、已入库动态列)
|
||||||
const columns = useFormItemColumns(tableData.value);
|
const columns = useFormItemColumns(tableData.value, props.disabled);
|
||||||
await gridApi.grid.reloadColumn(columns || []);
|
await gridApi.grid.reloadColumn(columns || []);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -274,7 +274,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -169,7 +169,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -246,6 +248,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -281,7 +281,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -206,6 +206,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(
|
export function useFormItemColumns(
|
||||||
formData?: any[],
|
formData?: any[],
|
||||||
|
disabled?: boolean,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
@@ -306,6 +307,7 @@ export function useFormItemColumns(
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(tableData.value),
|
columns: useFormItemColumns(tableData.value, props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -95,7 +95,7 @@ watch(
|
|||||||
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
||||||
await gridApi.grid.reloadData(tableData.value);
|
await gridApi.grid.reloadData(tableData.value);
|
||||||
// 更新表格列配置(目的:已入库、已退货动态列)
|
// 更新表格列配置(目的:已入库、已退货动态列)
|
||||||
const columns = useFormItemColumns(tableData.value);
|
const columns = useFormItemColumns(tableData.value, props.disabled);
|
||||||
await gridApi.grid.reloadColumn(columns || []);
|
await gridApi.grid.reloadColumn(columns || []);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -276,7 +276,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -181,7 +181,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -259,6 +261,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -281,7 +281,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(
|
export function useFormItemColumns(
|
||||||
formData?: any[],
|
formData?: any[],
|
||||||
|
disabled?: boolean,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
@@ -326,6 +327,7 @@ export function useFormItemColumns(
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(tableData.value, props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -95,7 +95,7 @@ watch(
|
|||||||
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
||||||
await gridApi.grid.reloadData(tableData.value);
|
await gridApi.grid.reloadData(tableData.value);
|
||||||
// 更新表格列配置(目的:原数量、已出库动态列)
|
// 更新表格列配置(目的:原数量、已出库动态列)
|
||||||
const columns = useFormItemColumns(tableData.value);
|
const columns = useFormItemColumns(tableData.value, props.disabled);
|
||||||
await gridApi.grid.reloadColumn(columns || []);
|
await gridApi.grid.reloadColumn(columns || []);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -274,7 +274,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(
|
export function useFormItemColumns(
|
||||||
formData?: any[],
|
formData?: any[],
|
||||||
|
disabled?: boolean,
|
||||||
): VxeTableGridOptions['columns'] {
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
@@ -319,6 +320,7 @@ export function useFormItemColumns(
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(tableData.value),
|
columns: useFormItemColumns(tableData.value, props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -95,7 +95,7 @@ watch(
|
|||||||
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
await nextTick(); // 特殊:保证 gridApi 已经初始化
|
||||||
await gridApi.grid.reloadData(tableData.value);
|
await gridApi.grid.reloadData(tableData.value);
|
||||||
// 更新表格列配置(目的:已出库、已出库动态列)
|
// 更新表格列配置(目的:已出库、已出库动态列)
|
||||||
const columns = useFormItemColumns(tableData.value);
|
const columns = useFormItemColumns(tableData.value, props.disabled);
|
||||||
await gridApi.grid.reloadColumn(columns || []);
|
await gridApi.grid.reloadColumn(columns || []);
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -274,7 +274,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -85,7 +85,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -156,6 +158,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -269,7 +269,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -163,6 +165,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -258,7 +258,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -85,7 +85,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -154,6 +156,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -279,7 +279,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ export function useFormSchema(formType: string): VbenFormSchema[] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 表单的明细表格列 */
|
/** 表单的明细表格列 */
|
||||||
export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
export function useFormItemColumns(
|
||||||
|
disabled: boolean,
|
||||||
|
): VxeTableGridOptions['columns'] {
|
||||||
return [
|
return [
|
||||||
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
{ type: 'seq', title: '序号', minWidth: 50, fixed: 'left' },
|
||||||
{
|
{
|
||||||
@@ -163,6 +165,7 @@ export function useFormItemColumns(): VxeTableGridOptions['columns'] {
|
|||||||
width: 50,
|
width: 50,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
slots: { default: 'actions' },
|
slots: { default: 'actions' },
|
||||||
|
visible: !disabled,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const summaries = computed(() => {
|
|||||||
/** 表格配置 */
|
/** 表格配置 */
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
const [Grid, gridApi] = useVbenVxeGrid({
|
||||||
gridOptions: {
|
gridOptions: {
|
||||||
columns: useFormItemColumns(),
|
columns: useFormItemColumns(props.disabled),
|
||||||
data: tableData.value,
|
data: tableData.value,
|
||||||
minHeight: 250,
|
minHeight: 250,
|
||||||
autoResize: true,
|
autoResize: true,
|
||||||
@@ -256,7 +256,6 @@ onMounted(async () => {
|
|||||||
</template>
|
</template>
|
||||||
<template #actions="{ row }">
|
<template #actions="{ row }">
|
||||||
<TableAction
|
<TableAction
|
||||||
v-if="!disabled"
|
|
||||||
:actions="[
|
:actions="[
|
||||||
{
|
{
|
||||||
label: '删除',
|
label: '删除',
|
||||||
|
|||||||
Reference in New Issue
Block a user