|
|
@ -3,7 +3,7 @@ import { Button, Form, Popconfirm, Divider, Space, Tooltip, Badge } from 'antd' |
|
|
|
import { useAtom, useAtomValue } from 'jotai' |
|
|
|
import { |
|
|
|
deleteAppPackageAtom, |
|
|
|
saveOrUpdateAppPackageAtom, appPackageAtom, appPackagesAtom, appPackageSearchAtom, |
|
|
|
saveOrUpdateAppPackageAtom, appPackageAtom, appPackagesAtom, appPackageSearchAtom, packageAppAtom, |
|
|
|
} from '@/store/app/package' |
|
|
|
import { useEffect, useMemo, useState } from 'react' |
|
|
|
import Action from '@/components/action/Action.tsx' |
|
|
@ -32,6 +32,7 @@ const AppPackage = () => { |
|
|
|
const [ currentAppPackage, setAppPackage ] = useAtom(appPackageAtom) |
|
|
|
const { data, isFetching, isLoading, refetch } = useAtomValue(appPackagesAtom) |
|
|
|
const { mutate: deleteAppPackage, isPending: isDeleting } = useAtomValue(deleteAppPackageAtom) |
|
|
|
const { mutate: packageApp, isPending: packageing } = useAtomValue(packageAppAtom) |
|
|
|
|
|
|
|
const [ open, setOpen ] = useState(false) |
|
|
|
const [ openFilter, setFilterOpen ] = useState(false) |
|
|
@ -226,12 +227,22 @@ const AppPackage = () => { |
|
|
|
valueType: 'option', |
|
|
|
fixed: 'right', |
|
|
|
render: (_, record) => [ |
|
|
|
<Action key="package" |
|
|
|
as={'a'} |
|
|
|
loading={packageing} |
|
|
|
disabled={![ 0, 4 ].includes(record.status) || packageing} |
|
|
|
onClick={() => { |
|
|
|
packageApp(record) |
|
|
|
}} |
|
|
|
>{t('actions.package', '应用打包')}</Action>, |
|
|
|
<Divider type={'vertical'}/>, |
|
|
|
<Action key="edit" |
|
|
|
as={'a'} |
|
|
|
onClick={() => { |
|
|
|
form.setFieldsValue(record) |
|
|
|
setOpen(true) |
|
|
|
}}>{t('actions.edit')}</Action>, |
|
|
|
<Divider type={'vertical'}/>, |
|
|
|
<Popconfirm |
|
|
|
key={'del_confirm'} |
|
|
|
disabled={isDeleting} |
|
|
@ -312,7 +323,7 @@ const AppPackage = () => { |
|
|
|
onRow={(record) => { |
|
|
|
return { |
|
|
|
className: cx({ |
|
|
|
'ant-table-row-selected': currentAppPackage?.id === record.id |
|
|
|
// 'ant-table-row-selected': currentAppPackage?.id === record.id
|
|
|
|
}), |
|
|
|
onClick: () => { |
|
|
|
setAppPackage(record) |
|
|
|