| | |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-06-22 01:02:52 |
| | | * @LastEditTime: 2024-06-24 15:50:49 |
| | | */ |
| | | |
| | | import { ActionItem } from '/@/components/Table'; |
| | | import { ActionItem, BasicColumn } from '/@/components/Table'; |
| | | import { buildUUID } from '/@/utils/uuid'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | |
| | | const { t } = useI18n(); |
| | | |
| | | function _default() { |
| | | /** |
| | | * @description: 产品绑定工艺路线操作字段自定义按钮 |
| | | * @return {*} |
| | | */ |
| | | function ActionItem(params: Recordable<any>, data, ...args): ActionItem[] { |
| | | data[0].onClick = rsnGrpEdit.bind(null, args, params); //替换主页面编辑按钮方法变为跳转到高级页面 |
| | | return data; |
| | | } |
| | | |
| | | /** |
| | | * @description: 自定义编辑方法,跳转到高级页面 |
| | | * @param {Fn} args |
| | |
| | | args[5](`/BAS_REASON/High/${encodeURI(JSON.stringify(param))}`); |
| | | } |
| | | |
| | | return [ActionItem]; |
| | | const ActionColumn: BasicColumn = { |
| | | width: 180, |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | slots: { customRender: 'action' }, |
| | | fixed: undefined, |
| | | }; |
| | | |
| | | const methods = { |
| | | /** |
| | | * @description: 获取新增按钮的行为 |
| | | * @return {*} |
| | | */ |
| | | CreateAction: (fnName: string) => { |
| | | return { |
| | | action: 'go', //drawer(打开左侧抽屉框) | go(跳转到新的页面) |
| | | url: 'BAS_REASON/High', |
| | | params: { |
| | | CODE: '0', |
| | | ID: buildUUID(), |
| | | Name: 'BAS_REASON', |
| | | Title: '新增不良原因组', |
| | | pCode: 'RSNG_CODE', |
| | | IsID: false, |
| | | }, |
| | | }; |
| | | }, |
| | | /** |
| | | * @description: 产品绑定工艺路线操作字段自定义按钮 |
| | | * @return {*} |
| | | */ |
| | | ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { |
| | | data[0].onClick = rsnGrpEdit.bind(null, args, params); //替换主页面编辑按钮方法变为跳转到高级页面 |
| | | return data; |
| | | }, |
| | | GetSelectSuccess: (d, u) => { |
| | | return { |
| | | RSNG_CODE: d.values['val'], |
| | | }; |
| | | }, |
| | | OpenSelectItem:(openItemModal: Fn) => { |
| | | openItemModal(true, { |
| | | title: '不良原因组列表', |
| | | schemas: [ |
| | | { |
| | | field: 'RSNG_CODE', |
| | | component: 'Input', |
| | | label: '不良原因组代码', |
| | | colProps: { |
| | | span: 12, |
| | | }, |
| | | }, |
| | | ], |
| | | ItemColumns: [ |
| | | { |
| | | title: t('不良原因组代码'), |
| | | dataIndex: 'RSNG_CODE', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 200, |
| | | }, |
| | | { |
| | | title: t('不良原因组名称'), |
| | | dataIndex: 'RSNG_NAME', |
| | | resizable: true, |
| | | sorter: true, |
| | | width: 180, |
| | | }, |
| | | ], |
| | | tableName: 'BAS_REASON_GRP', |
| | | rowKey: 'RSNG_CODE', |
| | | searchInfo: {TABLE_NAME: 'BAS_REASON_GRP'} |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | return [methods, ActionColumn]; |
| | | } |
| | | |
| | | export default _default; |