From f1d47feeee1ddb5751847b71f789f2c3b822ec32 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期日, 23 六月 2024 23:55:33 +0800 Subject: [PATCH] 详情页面优化 --- src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 169 insertions(+), 3 deletions(-) diff --git a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts index 9b096df..ddebf23 100644 --- a/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts +++ b/src/views/tigerprojects/system/lowcode/entityts/BAS_LABEL_VAR.ts @@ -4,10 +4,19 @@ * @version: * @Date: 2024-06-19 20:34:27 * @LastEditors: Ben Lin - * @LastEditTime: 2024-06-23 00:28:56 + * @LastEditTime: 2024-06-23 23:42:04 */ -import { ActionItem, BasicColumn } from "/@/components/Table"; +import { Tag, Tooltip } from 'ant-design-vue'; +import { ActionItem, BasicColumn } from '/@/components/Table'; +import { useI18n } from '/@/hooks/web/useI18n'; +import { h, unref } from 'vue'; +import { GetEnum } from '/@/api/tigerapi/system'; +import { useLocale } from '/@/locales/useLocale'; + +const { getLocale } = useLocale(); + +const { t } = useI18n(); function _default() { const ActionColumn: BasicColumn = { @@ -36,7 +45,164 @@ }, GetHomeUrl: () => { return `/BAS_LABEL_TEMP/LC/${encodeURI(JSON.stringify({ ID: 'BAS_LABEL_TEMP', colSlots: [], crudColSlots: [] }))}`; - } + }, + GetBaseColumns: () => { + return [ + { + dataIndex: 'LABEL_ID', + title: '鏍囩妯℃澘ID', + ifShow: false, + sorter: true, + resizable: true, + }, + { + dataIndex: 'VAR_NAME', + title: '鍙橀噺鍚嶇О', + ifShow: true, + sorter: true, + resizable: true, + customRender: () => {}, + }, + { + dataIndex: 'VAR_TYPE', + title: '鍙橀噺绫诲瀷', + ifShow: true, + sorter: true, + resizable: true, + customRender: ({ record }) => { + let color = ''; + let text = ''; + switch (record.VAR_TYPE) { + case 0: + text = '甯搁噺'; + color = 'green'; + break; + case 1: + text = '杩囩▼鍙橀噺'; + color = 'orange'; + break; + case 2: + text = '鏃ユ湡鍙橀噺'; + color = '#4f68b0'; + break; + case 3: + text = '鑷畾涔夊彉閲�'; + color = '#bfbfbf'; + break; + } + return h(Tooltip, { title: text }, () => h(Tag, { color: color }, () => text)); + }, + }, + { + dataIndex: 'VAR_VALUE', + title: '鍙橀噺鍊�', + ifShow: true, + sorter: true, + resizable: true, + }, + { + dataIndex: 'REMARK', + title: '澶囨敞', + ifShow: true, + sorter: true, + resizable: true, + }, + ]; + }, + GetSearchForm: () => { + return [ + { + field: 'VAR_NAME', + label: t('鍙橀噺鍚�'), + colProps: { span: 8 }, + component: 'Input', + }, + ]; + }, + GetCrudForm: () => { + let isShow = false; + return [ + { + field: 'ID', + label: '鍙橀噺ID', + component: 'Input', + colProps: { + span: 20, + }, + show: false, + }, + { + field: 'LABEL_ID', + label: '鏍囩妯℃澘ID', + component: 'Input', + colProps: { + span: 20, + }, + show: false, + }, + { + field: 'VAR_NAME', + label: '鍙橀噺鍚�', + required: true, + component: 'Input', + isexist: 'Y', + colProps: { + span: 20, + }, + }, + { + field: 'VAR_TYPE', + label: '鍙橀噺绫诲瀷', + component: 'ApiSelect', + colProps: { + span: 20, + }, + componentProps: { + api: GetEnum, + params: { name: 'BAS_LABEL_VAR+VAR_TYPEs' }, + resultField: 'Data', + labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', + valueField: 'Value', + onChange: (e) => { + if (e == 1) { + isShow = true; + } else { + isShow = false; + } + }, + }, + }, + { + field: 'VAR_VALUE', + label: '鍙橀噺鍊�', + required: true, + component: 'Input', + colProps: { + span: 20, + }, + }, + { + field: 'BAS_LABEL_PV1PSelect_0', //鎸変綆浠g爜閰嶇疆鐨勮鍒欙紝瀹炰綋鍚�+搴忓彿+PSelect_0锛屽簭鍙风敤鏉ュ尯鍒嗗涓殑鏃跺�欙紝PSelect_0杩欐槸涓浐瀹氬悗缂� + label: '1', + defaultValue: 'BAS_LABEL_PV', + component: 'Input', + colProps: { span: 4 }, + ifShow: ({ values }) => isShow, + colSlot: 'BAS_LABEL_PV1add', //鎸変綆浠g爜閰嶇疆鐨勮鍒欙紝瀹炰綋鍚�+搴忓彿+add锛屽簭鍙风敤鏉ュ尯鍒嗗涓殑鏃跺�欙紝add杩欐槸涓浐瀹氬悗缂� + }, + { + field: 'REMARK', + label: '澶囨敞', + component: 'Input', + colProps: { + span: 20, + }, + }, + ]; + }, + OthersValues: (val: string, id: string) => { + return { LABEL_ID: id }; + }, }; return [methods, ActionColumn]; -- Gitblit v1.9.3