| | |
| | | * @version: |
| | | * @Date: 2024-06-19 20:34:27 |
| | | * @LastEditors: Ben Lin |
| | | * @LastEditTime: 2024-07-03 21:37:02 |
| | | * @LastEditTime: 2024-07-04 11:21:28 |
| | | */ |
| | | |
| | | import { Ref, h, unref } from 'vue'; |
| | |
| | | import { Tag } from 'ant-design-vue'; |
| | | import { useLocale } from '/@/locales/useLocale'; |
| | | import { useDrawer } from '/@/components/Drawer'; |
| | | import { EditOperation, Search } from '../data'; |
| | | import { EditOperation, Search, custDel } from '../data'; |
| | | |
| | | const { getLocale } = useLocale(); |
| | | function _default() { |
| | |
| | | * @description: 获取新增按钮的行为 |
| | | * @return {*} |
| | | */ |
| | | CreateAction: (fnName: string) => { |
| | | CreateAction: (type: string) => { |
| | | return { |
| | | action: 'drawer', //drawer(打开左侧抽屉框) | go(跳转到新的页面) |
| | | }; |
| | |
| | | */ |
| | | ActionItem: (params: Recordable<any>, data, ...args): ActionItem[] => { |
| | | if (!isNullOrUnDef(data[1])) { |
| | | data[1].popConfirm.confirm = DftGrpDel.bind(null, args, params); |
| | | data[1].popConfirm.confirm = custDel.bind(null, args, params); |
| | | } |
| | | return data; |
| | | }, |
| | |
| | | slots: [], |
| | | preIcons: {}, |
| | | title: '不良代码组信息', |
| | | entityName: 'BAS_DEFECT_GRP', |
| | | entityName: 'BAS_DEFECT_GRP', |
| | | }, |
| | | // { |
| | | // name: 'prodinfo', |
| | |
| | | submitFunc: () => Search('BAS_DEFECT', data, args[0]), //自定义查询提交按钮的方法,触发查询提交事件 |
| | | }, |
| | | useSearchForm: true, |
| | | showTableSetting: true, |
| | | showTableSetting: false, |
| | | bordered: true, |
| | | canResize: true, |
| | | showIndexColumn: false, |
| | |
| | | } |
| | | }; |
| | | }, |
| | | GetUseForm: () => { |
| | | return {}; |
| | | }, |
| | | }; |
| | | |
| | | /** |
| | | * @description: 自定义删除方法 |
| | | * @param {Fn} args |
| | | * @param {*} params |
| | | * @return {*} |
| | | */ |
| | | function DftGrpDel(args: Fn[], params: {}) { |
| | | const name = params['name']; |
| | | if (!isNullOrEmpty(params['data'])) { |
| | | var _data = params['data'].value[name].filter((item) => item['ID'] != params['record']['ID']); |
| | | params['data'].value[name] = _data; |
| | | args[6]({ |
| | | dataSource: [], |
| | | }); |
| | | args[6]({ |
| | | dataSource: params['data'].value[name], |
| | | }); |
| | | args[1](); |
| | | } else { |
| | | DeleteEntity(params['record'], params['entityName']).then((action) => { |
| | | if (action.IsSuccessed) { |
| | | args[1](); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | /* 以下是内部方法,不export,供上面的方法调用 */ |
| | | |
| | | const baseColumns = { |
| | | BAS_DEFECT: [ |