| | |
| | | import Scope from './components/scope' |
| | | import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch' |
| | | import { statusMap } from '@/utils/enum-util' |
| | | import { repairBug } from '@/utils/common-util'; |
| | | |
| | | const TABLE_KEY = "pro-table-role"; |
| | | |
| | | const handleSave = async (val) => { |
| | | const hide = message.loading('正在添加'); |
| | |
| | | title: '备注', |
| | | dataIndex: 'memo', |
| | | valueType: 'text', |
| | | hidden: false, |
| | | filterDropdown: (props) => <TextFilter |
| | | name='memo' |
| | | {...props} |
| | |
| | | } |
| | | }} |
| | | columnsState={{ |
| | | persistenceKey: 'pro-table-role', |
| | | persistenceKey: TABLE_KEY, |
| | | persistenceType: 'localStorage', |
| | | defaultValue: { |
| | | memo: { show: repairBug(TABLE_KEY, 'memo', false) }, |
| | | option: { fixed: 'right', disable: true }, |
| | | }, |
| | | onChange(value) { |
New file |
| | |
| | | export const generateColumnsState = (cols) => cols.reduce((acc, { dataIndex, show = true }) => ({ ...acc, [dataIndex]: { show: show } }), {}); |
| | | |
| | | |
| | | export const repairBug = (tabKey, key, val) => { |
| | | const stateStr = localStorage.getItem(tabKey); |
| | | if (stateStr) { |
| | | const state = JSON.parse(stateStr); |
| | | const oldVal = state[key].show; |
| | | let hasVal = false; |
| | | if (oldVal === true) { |
| | | hasVal = true; |
| | | } |
| | | if (oldVal === false) { |
| | | hasVal = true; |
| | | } |
| | | if (hasVal) { |
| | | return oldVal; |
| | | } else { |
| | | return val; |
| | | } |
| | | } else { |
| | | return val; |
| | | } |
| | | } |
| | |
| | | import Edit from './components/edit' |
| | | import { TextFilter, SelectFilter, DatetimeRangeFilter, LinkFilter } from '@/components/TableSearch' |
| | | import { statusMap } from '@/utils/enum-util' |
| | | import { repairBug } from '@/utils/common-util'; |
| | | |
| | | const TABLE_KEY = "pro-table-role"; |
| | | |
| | | const handleSave = async (val) => { |
| | | const hide = message.loading('正在添加'); |
| | |
| | | } |
| | | }} |
| | | columnsState={{ |
| | | persistenceKey: 'pro-table-@{SIMPLEENTITYNAME}', |
| | | persistenceKey: TABLE_KEY, |
| | | persistenceType: 'localStorage', |
| | | defaultValue: { |
| | | option: { fixed: 'right', disable: true }, |