From 46c3d28c5633baaddad0da441185310b9360a45b Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期三, 03 七月 2024 14:56:21 +0800 Subject: [PATCH] 高级表单优化 --- src/views/tigerprojects/system/menu/menu.data.ts | 70 ++++++++++++++++++++++++++--------- 1 files changed, 52 insertions(+), 18 deletions(-) diff --git a/src/views/tigerprojects/system/menu/menu.data.ts b/src/views/tigerprojects/system/menu/menu.data.ts index 3fd9e39..effe051 100644 --- a/src/views/tigerprojects/system/menu/menu.data.ts +++ b/src/views/tigerprojects/system/menu/menu.data.ts @@ -1,14 +1,17 @@ import { BasicColumn } from '/@/components/Table'; import { FormSchema } from '/@/components/Table'; -import { h } from 'vue'; +import { h, unref } from 'vue'; import { Tag } from 'ant-design-vue'; -import { Icon } from '/@/components/Icon'; +import Icon from '@/components/Icon/Icon.vue'; +import { GetEnum } from '/@/api/tigerapi/system'; +import { useLocale } from '/@/locales/useLocale'; +const { getLocale } = useLocale(); export const columns: BasicColumn[] = [ { title: '鑿滃崟鍚嶇О', dataIndex: 'name', - width: 200, + width: 280, align: 'left', }, { @@ -33,7 +36,7 @@ dataIndex: 'orderNo', width: 100, customRender: ({ record }) => { - return h("h1", null, record.orderNo); //娓叉煋鍗曞厓鏍兼暟鎹紝h鏄繑鍥炰竴涓�滆櫄鎷熻妭鐐� (virtual node)鈥� + return h('h1', null, record.orderNo); //娓叉煋鍗曞厓鏍兼暟鎹紝h鏄繑鍥炰竴涓�滆櫄鎷熻妭鐐� (virtual node)鈥� }, }, { @@ -52,6 +55,16 @@ title: '鍒涘缓鏃堕棿', dataIndex: 'createTime', }, + { + title: '鎸夐挳绫诲瀷', + dataIndex: 'btnType', + ifShow: false, + }, + { + title: '鎵ц鏂规硶', + dataIndex: 'doMethod', + ifShow: false, + }, ]; const isDir = (type: string) => type === '0'; @@ -65,18 +78,18 @@ component: 'Input', colProps: { span: 8 }, }, - { - field: 'status', - label: '鐘舵��', - component: 'Select', - componentProps: { - options: [ - { label: '鍚敤', value: '1' }, - { label: '鍋滅敤', value: '0' }, - ], - }, - colProps: { span: 8 }, - }, + // { + // field: 'status', + // label: '鐘舵��', + // component: 'Select', + // componentProps: { + // options: [ + // { label: '鍚敤', value: '1' }, + // { label: '鍋滅敤', value: '0' }, + // ], + // }, + // colProps: { span: 8 }, + // }, ]; export const formSchema: FormSchema[] = [ @@ -126,7 +139,7 @@ label: '鍥炬爣', component: 'IconPicker', required: ({ values }) => isDir(values.func_type), - ifShow: ({ values }) => !isButton(values.func_type), + ifShow: ({ values }) => true, //!isButton(values.func_type), }, { @@ -143,10 +156,31 @@ ifShow: ({ values }) => isMenu(values.func_type), }, { + field: 'btnType', + label: '鎸夐挳绫诲瀷', + component: 'ApiSelect', + defaultValue: 0, + componentProps: { + api: GetEnum, + params: { name: 'SYS_MENU+BUTTON_TYPEs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + placeholder: '璇烽�夋嫨鎸夐挳绫诲瀷', + }, + ifShow: ({ values }) => isButton(values.func_type), + }, + { + field: 'doMethod', + label: '鎵ц鏂规硶鍚�', + component: 'Input', + ifShow: ({ values }) => isButton(values.func_type), + }, + { field: 'func_code', label: '鏉冮檺鏍囪瘑', component: 'Input', - dynamicDisabled:true, + dynamicDisabled: true, ifShow: ({ values }) => !isDir(values.func_type), }, { -- Gitblit v1.9.3