From ce374a9f4920a2d0e5ebe81a9872436088db6d55 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期五, 07 三月 2025 15:57:34 +0800 Subject: [PATCH] 高级页面主Form日期字段转换格式,否则出错 --- src/views/tigerprojects/system/menu/menu.data.ts | 75 ++++++++++++++++++++++++++++--------- 1 files changed, 57 insertions(+), 18 deletions(-) diff --git a/src/views/tigerprojects/system/menu/menu.data.ts b/src/views/tigerprojects/system/menu/menu.data.ts index cae797c..9ed4ba2 100644 --- a/src/views/tigerprojects/system/menu/menu.data.ts +++ b/src/views/tigerprojects/system/menu/menu.data.ts @@ -1,9 +1,12 @@ 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: '鑿滃崟鍚嶇О', @@ -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,11 +156,38 @@ 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), + }, + { + field: 'func_group', + label: '鍔熻兘缁�', + component: 'Input', + defaultValue: '', }, { field: 'status', @@ -188,7 +228,6 @@ }, ifShow: ({ values }) => isMenu(values.func_type), }, - { field: 'show', label: '鏄惁鏄剧ず', -- Gitblit v1.9.3