| | |
| | | * @version: |
| | | * @Date: 2024-06-18 15:09:48 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-06-22 22:54:16 |
| | | * @LastEditTime: 2024-06-23 00:31:33 |
| | | --> |
| | | <!-- |
| | | * @Description: 低代码详情呈现页面 |
| | |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | //详情列表 |
| | | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| | | import { |
| | | OpenCustModal, |
| | | OpenSelectItem, |
| | | custOnChange, |
| | | getHomeUrl, |
| | | } from '../data'; |
| | | import { OpenCustModal, custOnChange } from '../data'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import { DeleteEntity, getListByPage } from '/@/api/tigerapi/system'; |
| | |
| | | import { useGlobSetting } from '/@/hooks/setting'; |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { GetBaseColumns, GetFormColumns, GetSearchFormColumns } from './data'; |
| | | import { isNullOrUnDef } from '/@/utils/is'; |
| | | |
| | | const { t } = useI18n(); |
| | | |
| | | const { t: bt } = useI18n(''); |
| | | const { createMessage } = useMessage(); |
| | |
| | | schemas: GetSearchFormColumns(entityName.value, 'detailfirst'), |
| | | }, |
| | | actionColumn: { |
| | | width: 80, |
| | | width: 130, |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | slots: { customRender: 'action' }, |
| | |
| | | |
| | | // 页面左侧点击返回链接时的操作 |
| | | function goBack() { |
| | | go(getHomeUrl(entityName.value)); |
| | | /* 动态import实体名.ts的自定义方法 */ |
| | | try { |
| | | import(/* @vite-ignore */ `../entityts/${entityName.value}`) |
| | | .then((m) => { |
| | | const [{ GetHomeUrl }] = m.default(); |
| | | // 本例的效果时点击返回始终跳转到账号列表页,实际应用时可返回上一页 |
| | | go(GetHomeUrl(entityName.value)); |
| | | }) |
| | | .catch(() => {}); |
| | | } catch (e) {} |
| | | } |
| | | const tabClkcallback = (val: string) => { |
| | | if (val == 'detailfirst') { |
| | |
| | | try { |
| | | import( |
| | | /* @vite-ignore */ `../entityts/${getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`]}` |
| | | ).then((m) => { |
| | | ) |
| | | .then((m) => { |
| | | const [{ GetSelectSuccess }] = m.default(); |
| | | getForm().setFieldsValue(GetSelectSuccess(d, u)); |
| | | }) |
| | | .catch(() => { |
| | | getForm().setFieldsValue({ |
| | | ITEM_CODE: d.values['val'], |
| | | }); |
| | | }); |
| | | } catch (e) {} |
| | | } |
| | |
| | | * @return {*} |
| | | */ |
| | | function handleSelectItem(item) { |
| | | OpenSelectItem( |
| | | openItemModal, |
| | | getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`], |
| | | ); |
| | | /* 动态import实体名.ts的自定义方法 */ |
| | | try { |
| | | import( |
| | | /* @vite-ignore */ `../entityts/${getForm().getFieldsValue()[`${item.replace(/form-/, '').replace(/add/, '')}PSelect_0`]}` |
| | | ) |
| | | .then((m) => { |
| | | const [{ OpenSelectItem }] = m.default(); |
| | | OpenSelectItem(openItemModal); |
| | | }) |
| | | .catch(() => { |
| | | openItemModal(true, { |
| | | title: '物料列表', |
| | | schemas: [ |
| | | { |
| | | field: 'ITEM_CODE', |
| | | component: 'Input', |
| | | label: '物料编码', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('物料编码'), |
| | | dataIndex: 'ITEM_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('物料名称'), |
| | | dataIndex: 'ITEM_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'BAS_ITEM', |
| | | rowKey: 'ITEM_CODE', |
| | | searchInfo: { TABLE_NAME: 'BAS_ITEM' }, |
| | | }); |
| | | }); |
| | | } catch (e) {} |
| | | } |
| | | |
| | | /** |